Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: Viper013 on November 14, 2023, 06:52:45 AM

Title: How can i align "header" and "footer" to "main_content" ?
Post by: Viper013 on November 14, 2023, 06:52:45 AM
Hello everyone,

I am currently working on adapting my old theme to the new SMF version 2.1.4. (SMF Default Theme - Curve2)

It works so far, but I'm stuck on one problem.
By default the "header" and "footer" are full-width.

How can I bring the "header" and the "footer" into alignment with the "main-content" ?

I would be very grateful for a little help.

Thanks
Steffen





Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Viper013 on November 17, 2023, 04:02:35 AM
... does nobody really have any ideas ?
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Mr.Truckman on November 17, 2023, 08:38:50 AM
Quote from: Viper013 on November 14, 2023, 06:52:45 AMHello everyone,

I am currently working on adapting my old theme to the new SMF version 2.1.4. (SMF Default Theme - Curve2)

It works so far, but I'm stuck on one problem.
By default the "header" and "footer" are full-width.

How can I bring the "header" and the "footer" into alignment with the "main-content" ?

I would be very grateful for a little help.

Thanks
Steffen








File Edits / index.css

find:


/* The top bar. */
#top_section {
  padding: 0 5%;
  border-bottom: 1px solid #bbb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  background: #fff;
  clear: both;
}

replace:

/* The top bar. */
#top_section {
  width: 85%;
  margin: 0 auto;
  padding: 0 5%;
  border-bottom: 1px solid #bbb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  background: #fff;
  clear: both;
}


find:
/* The footer with copyright links etc. */
#footer {
   padding: 10px 5%;
   background: #3e5a78;
   border-top: 3px solid #b2b6bd;
   flex: none;

}

replace:
/* The footer with copyright links etc. */
#footer {
   width: 85%;
   margin: 0 auto;
   padding: 10px 5%;
   background: #3e5a78;
   border-top: 3px solid #b2b6bd;
   flex: none;

}
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Viper013 on November 17, 2023, 09:43:47 AM
Hi Mr. Truckman,

thank you very much for your help.

Works perfectly for the PC, ... but unfortunately it is no longer responsive on mobile devices.
There, the "header" and "footer" are now significantly smaller than the "main_content".

But many thanks for your efforts.

Greetings
Steffen
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: TwitchisMental on November 17, 2023, 11:06:06 AM
Can you provide a link to your site?

Have you tried using the inspect element tool to see what needs changed specifically?

Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Viper013 on November 17, 2023, 11:37:18 AM
... here is the link to the site.

I tried the Firefox_Inspektor, ... but i am not able to handle the problem.  :(

Link:    https://2-test.modellbauforen2.1.sklein.eu/index.php (https://2-test.modellbauforen2.1.sklein.eu/index.php)

User: Test
PW: test1234


Its just a Test-Site before i am upgrading my Forum to SMF 2.1.4

Thank you  :)
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Julius_2000 on November 17, 2023, 01:20:27 PM
Quote from: Viper013 on November 17, 2023, 09:43:47 AMHi Mr. Truckman,

thank you very much for your help.

Works perfectly for the PC, ... but unfortunately it is no longer responsive on mobile devices.
There, the "header" and "footer" are now significantly smaller than the "main_content".

But many thanks for your efforts.

Greetings
Steffen
The most likely reason is that in your responsive.css, there's no individual width specified for smaller devices, now that you changed it in index.css. As a result of this, the 85% width is applied to all screen sizes, making it even smaller on smaller screens (e.g. 85% of a 720px screen width).

Just add a width of 100% to a media query for a screen width of like 720px for example.

For instance in responsive.css:


@media (max-width: 720px) {
      #header, #footer {
           width: 100%;
      }
}
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Viper013 on November 17, 2023, 02:08:54 PM
Hi Julius,

the hint to the responsive.css was the key and now it works.

Thank you very much.


Greetings
Steffen
Title: Re: How can i align "header" and "footer" to "main_content" ?
Post by: Julius_2000 on November 23, 2023, 04:06:15 PM
Aber gerne!