CSS中的float和align属性之间的差异 [英] Difference between float and align property in CSS

查看:298
本文介绍了CSS中的float和align属性之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的客户设计了一个网站,没有太多的网页设计和CSS的经验。我也想用标准的CSS方式设计它。

I am designing a website for my client and do not have much experience in web design and CSS. I also want to design it in standard CSS way.

问题是我对CSS align属性和float属性很困惑。我知道这两个属性之间有很大的区别,但是我仍然无法在开发时正确处理它。

The question is I am quite confused with CSS align property and float property. I know there is much difference between these two properties but I am still not able to handle it correctly at the time of development.

任何人都可以向我解释这两个属性?

Can anyone explain to me the exact difference between these two properties?

推荐答案

首先我建议你参考头文件系列CSS和HTML by O' Reilly出版物。这是一个必须为那些新的设计读的书。

First I would like to suggest that you refer to the Head First series of CSS and HTML by O'Reilly publications. This is a must read book for those new to designing.

所以,float属性用于移动很多块(例如你的侧边栏,你的内容区域等) 。)和你正在说的HTML对齐,你可以这样在CSS中做同样的事情。

So, the float property is used to move a lot of blocks (for example your sidebar, your content area etc.) and the HTML align thing you are talking about, you can do the same in CSS in this way.

.test{
text-align: right; 
}   

上面提到的代码将是CSS, p>

The above code mentioned will be CSS and equivalent HTML code will be.

<div class="test"> This text will be aligned from right </div>    

暂时参考O'Reilly首先使用HTML和CSS,将帮助你。

For the time being refer to O'Reilly head first with HTML AND CSS, will help you a lot.

这篇关于CSS中的float和align属性之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆