开发者

garbled items in a horizontal list with css

开发者 https://www.devze.com 2022-12-24 18:20 出处:网络
I have made a page in which i m using a list to display the items horizontally Now i can see the result in the page here

I have made a page in which i m using a list to display the items horizontally

Now i can see the result in the page here

But when i drag and make the browser window short i get a garbled list as in the scrren-shot here

http://pradyut.dyndns.org/WebApplicationSecurity/people_ss.JPG

http://pradyut.dyndns.org/WebApplicationSecurity/people_ss.JPG

I m using a css in the list as : -

#navlist li
        {

            padding: 1em;
            float: left;
            list-style-type: none;
        }

at the end of the list i m using a clearing div

#clear-both 
{
   clear: both;
}

Any help

Thanks开发者_如何学运维

Pradyut

[2]: [2]: http://pradyut.dyndns.org/WebApplicationSecurity/people_ss.JPG


I can't seem to access your site.

Try using display:inline instead of float:left

#navlist li
{
padding-right: 1em;
display: inline;
list-style-type: none;
}


The problem is the varying heights of each LI element. If you give them all a common height, the layout flows properly when the window is resized:

#navlist li
{
    height: 100px;
    padding: 1em;
    float: left;
    list-style-type: none;
}


well could solve the problem using a min-height in the another div css

  #another 
  {
      padding: 5px;
      background-color: green;
      min-height: 75px;
  }

thanks...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号