登录 | 注册 | FAQ
Anonymous

banner across full page

+ 发表回复

2 篇帖子 分页: 1 / 1


banner across full page

stonoby » 周一 9月 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
头像

stonoby

  • 帖子: 1
  • 注册: 周一 9月 29, 2014 6:40 pm

Re: banner across full page

XainPro » 周六 10月 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
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm


+ 发表回复

分页: 1 / 1