简体   繁体   English

Div内容从左到右对齐?

[英]Div contents are aligning left to right?

The contents of my Div's are not playing nice. 我的Div的内容并不好看。

The items listed under "Browse by Category" are working right, listed vertical as they should be. “按类别浏览”下列出的项目是正常工作的,应按原样列出。 The "useful links" and "browse by price" are not! “有用的链接”和“按价格浏览”不是!

In this picture you can see them, and I marked up in red how they should be. 在这张图片中你可以看到它们,我用红色标记它们应该是什么样的。 Can anyone help? 有人可以帮忙吗?

Here is my website: http://www.heatx.org/productcart/pc/viewCategories.asp?idCategory=2 这是我的网站: http//www.heatx.org/productcart/pc/viewCategories.asp?idCategory = 2

在此输入图像描述

your problem is in menu.css on line 8: 你的问题出在第8行的menu.css:

ul li {float: left;}

all lis in your site are floated left. 您站点中的所有lis都向左浮动。 You need to specifically target which ones you want to float as you shouldn't float all of them 你需要专门定位你想要浮动的那些,因为你不应该浮动它们

I think you use this line for your header navigation. 我认为您使用此行作为标题导航。 If you give the ul for the header nav an id: 如果你给头文件导航的ul一个id:

<ul id="headerNav">

you can target that ul with 你可以用那个ul来定位

ul#headerNav li {float: left;}

ps. PS。 you shouldn't use tables for layout, they are for tabular data only 您不应该使用表格进行布局,它们仅用于表格数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM