Zaloguj | Zarejestruj | FAQ
Anonymous

banner across full page

+ Odpowiedz

Posty: 2 Strona 1 z 1


banner across full page

przez stonoby » Pn wrz 29, 2014 7:13 pm

Hello,i am new to HTML.net i need my Banner to go across the full page of my site all i know is
that text-align:center;to#bannerback has something to do with solving the problem.Thanks for any help
Stonoby
Avatar użytkownika

stonoby

  • Posty: 1
  • Dołączył(a): Pn wrz 29, 2014 6:40 pm

Re: banner across full page

przez XainPro » So paź 04, 2014 5:15 am

To get an element to fill the width of the viewport, it should either be absolutely positioned, and a descendant only of elements which also fill the width of the viewport (eg: body, descendant divs of body which do not have set widths), OR it should be fixed position. Then, the element needs to have left: 0 and right: 0.

Change your #bar ruleset to this:

#bar{
background:white;
font-family:Designio;
position:absolute;
left: 0;
right: 0;
padding:15px;
height:60px;
background-size:100%;
}

summary:

Remove all redundant sizing and negative margin properties.
Fix the typo in your stylesheet - change position: absoulte to position: absolute.
Set left: 0 and right: 0
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm


+ Odpowiedz

Strona 1 z 1