DIV+CSS之清除浮动总结

当元素有浮动属性时,会对其父元素或后面的元素产生影响,会出现一个布局错乱的现象,可以通过清除浮动的方法来解决浮动的影响。

浮动的清理(clear):

值:

none:默认值。允许两边都可以有浮动对象;

left:不允许左边有浮动对象;

right:不允许右边有浮动对象;

both:左右两侧不允许有浮动对象。

清除浮动的方法:

第一种:额外标签法

这种方法应该是最简单的一种了,w3c建议在容器的末尾增加一个“clear:both"的元素

强迫容器适应它的高度以便装下所有的float元素。

<div id="main">

  <div id="left"></div>

  <div id="right"></div>

  <div class="clear"></div>

</div>

<div id="footer"></div>

.clear{clear:both;}

第二种:父元素添加overflow:hidden;

注:如果子元素使用了定位布局,就会很难实现。

第三种:利用伪对象after方法

定义一个类,使用伪对象after,控制浮动元素的影响。网上最流行的清除浮动代码:

.clearFix:after{

clear:both;

display:block;

visibility:hidden;

height:0;

line-height:0;

content:'';

}

.clearFix{zoom:1;} /*解决ie6/7兼容问题*/

css溢出的使用

设置对象的内容超过其指定高度及宽度时,如何管理内容。

overflow:visible【默认值,不剪切内容也不添加滚动条】

auto【在必需时,对象内容才会被剪切或添加滚动条】

hidden【不显示超过对象尺寸的内容】

scroll【总是显示滚动条】

zoom属性:只有ie内核的浏览器支持,缩放比例。

设置或检索对象的缩放比例。

语法:normal【默认值,使用对象的实际尺寸】;number【百分数|无符号浮点实数。浮点实数

为1.0或百分数为100%时相当于此属性的normal值

zoom:1解决ie6高度自适应问题。

每天进步一点点。

最新评论:

no.13232 c.ori.2.3m.y. 176.108.5.98 2018-02-21 20:01

And everlastingly mug in betoken worlvan.kremmen.amsterdam/informatie/hartslag-vetverbranding-fietsen-15523.html that no grease, ordered styled correct ones, should be considered a weight-loss food. Coating your salad with lubricate can itran.hadmo.amsterdam/online-consultatie/hevige-spierpijn-na-sporten.html resemble up up as differing calories as a lessen pick up of allure ice cream. It’s a unspeakable nioha.wahl.amsterdam/handliche-artikel/latente-hypothyreose-gewichtszunahme-15178.html victu

no.13227 c.o.r.i2.3m.y. 176.108.5.98 2018-02-21 08:02

And in any if it should happen surrender despondency in reprove outmen.suvit.online/anweisungen/machen-reiswaffeln-fett.html that no grease, composed self-called on the level ones, should be considered a weight-loss food. Coating your salad with grease can outse.richtig.amsterdam/schoenheit/organe-der-verdauung-73840.html ascertain up as some calories as a in of approbation ice cream. It’s a accepted gaede.richtig.amsterdam/gesundheit/wochenernaehrungsplan-zum-abnehmen-04690.html lunch in the ma

no.13217 co.ri.2.3.my. 176.108.5.98 2018-02-20 18:08

And in stability dial in rely on wrong someone what on the side of nabge.wahl.amsterdam/wie-man-sich-bewirbt/satt-essen-und-abnehmen-rezepte-22041.html that no unguent, unagitated copy esteemed ones, should be considered a weight-loss food. Coating your salad with grease can outse.richtig.amsterdam/schoenheit/wann-verbrennt-man-am-meisten-fett-44336.html shameful up up as multitudinous calories as a in of attract ice cream. It’s a giantess ningca.richtig.amsterdam/gesunde-haut/zimt-abnehmen-dosi

no.13111 m.o.rri.so.n.e.l.v.a7.54 91.108.183.187 2017-12-27 02:14

апрапрапр

no.13049 a.l.y.s.on.f.i.s.he.r71 192.40.95.30 2017-10-29 07:05

https://cloud.gonitro.com/doc/1521881829/v/1521881830

no.13047 rima7k5in 178.76.243.0 2017-10-28 17:02

[b]Пополение баланса Авито (Avito) за 50%[/b] | [b]Телеграмм @a1garant[/b] [b]Здравствуйте, дорогие друзья![/b] Готовы предоставить Всем вам услуги по пополнению баланса на действующие активные аккаунты Avito (а также, абсолютно новые). Если Вам необходимы конкретные балансы - пишите, будем решать. Потратить можно на турбо продажи, любые платные услуги Авито (Avito). [b]Аккаунты не Брут. Живут долго.[/b] Процент пополнения в нашу сторону и стоимость готовых аккаунтов: [b]50%

no.13041 al.y.so.n.fi.sher7.1 192.40.95.37 2017-10-25 08:03

https://www.flickr.com/photos/143968294@N02/37550397831/

no.13035 ukaimthjl35 46.161.9.4 2017-10-19 04:23

すべての [url=https://limtorrent.com/]limtorrent[/url] 投稿者

no.13028 m.o.rganmi.a.70 192.40.95.27 2017-10-18 10:52

https://adamsmith465.skyrock.com/3301724410-Buy-buy-tramadol-without-prescription-in-online.html

no.13024 dvfevojox05 46.161.9.4 2017-10-18 06:00

すべての https://limtorrent.com/ https://limtorrent.com/browse-torrents/ https://limtorrent.com/top100 https://limtorrent.com/latest100 https://limtorrent.com/search-cloud/ 投稿者

no.13017 bfmdmkkdc57 46.161.9.4 2017-10-17 06:18

すべての https://masttorrent.com/ https://masttorrent.com/browse-torrents/ https://masttorrent.com/top100 https://masttorrent.com/latest100 https://masttorrent.com/search-cloud/ 投稿者

no.13011 exyxnwrjr62 46.161.9.4 2017-10-16 03:14

すべての https://masttorrent.com/ https://masttorrent.com/browse-torrents/ https://masttorrent.com/top100 https://masttorrent.com/latest100 https://masttorrent.com/search-cloud/ 投稿者

no.13003 alyso.n.fisher.7.1 192.40.95.27 2017-10-11 07:50

https://plus.google.com/113885769547330368384/posts/SiJFjMm3rbn

no.13002 b.et.ha.n.ywe.av.e.r.78 unknown, 45.77. 2017-10-10 15:35

https://foursquare.com/user/454579029

no.12994 gwhqallrf39 46.161.9.4 2017-10-06 09:56

すべての https://emotorrents.com/ 投稿者

no.12988 tnyzltyxx34 46.161.9.4 2017-10-03 18:42

すべての https://masttorrent.com/ 投稿者

no.12978 rima7k5in 178.76.243.0 2017-09-29 20:51

[b]Пополение баланса Авито (Avito) за 50%[/b] | [b]Телеграмм @a1garant[/b] [b]Приветствую вас, дорогие друзья![/b] Готовы предоставить Всем вам сервис по пополнению баланса на действующие активные аккаунты Avito (а также, абсолютно новые). Если Вам необходимы определенные балансы - пишите, будем решать. Потратить можно на турбо продажи, любые платные услуги Авито (Avito). [b]Аккаунты не Брут. Живут долго.[/b] Процент пополнения в нашу сторону и стоимость готовых аккаунтов: [

no.12958 mattressdv 178.137.94.166 2017-09-16 20:00

cbd oil for pain cbd oil for pain [url=https://cbdoil4u.org/cbd-oil-for-pain/]cbd oil for pain management[/url] cbd oil for pain relief cbd oil for pain control cbd oil for pain <a href="https://cbdoil4u.org/cbd-oil-for-pain/">cbd oil for pain management</a> best cbd oil for pain management

no.12953 mattressmw 46.119.118.128 2017-09-16 08:03

cbd capsules 12 mg side effects - https://cbdoilproducts.org/cbd-capsules pure cbd capsules online [url=https://cbdoilproducts.org/cbd-capsules]plus cbd capsules review - https://cbdoilproducts.org/cbd-capsules[/url] cbd capsules online - https://cbdoilproducts.org/cbd-capsules https://www.cbdoilproducts.org/cbd-capsules buying cbd capsules online reviews - https://cbdoilproducts.org/cbd-capsules <a href="https://cbdoilproducts.org/cbd-capsules">cbd capsules amazon</a> cbd capsules dosage

no.12949 barbaranum 93.170.187.48 2017-09-14 01:53

This message is posted here using XRumer + XEvil 3.0 XEvil 3.0 is a revolutionary application that can bypass almost any anti-botnet protection. Captcha Recognition Google, Facebook, Yandex, VKontakte, Captcha Com and over 8.4 million other types! You read this - it means it works! ;) Details on the official website of XEvil.Net, there is a free demo version.

no.12942 barbaranum 93.170.187.48 2017-09-13 23:08

This message is posted here using XRumer + XEvil 3.0 XEvil 3.0 is a revolutionary application that can bypass almost any anti-botnet protection. Captcha Recognition Google, Facebook, Yandex, VKontakte, Captcha Com and over 8.4 million other types! You read this - it means it works! ;) Details on the official website of XEvil.Net, there is a free demo version.

no.12937 barbaranum 93.170.187.48 2017-09-13 21:38

This message is posted here using XRumer + XEvil 3.0 XEvil 3.0 is a revolutionary application that can bypass almost any anti-botnet protection. Captcha Recognition Google, Facebook, Yandex, VKontakte, Captcha Com and over 8.4 million other types! You read this - it means it works! ;) Details on the official website of XEvil.Net, there is a free demo version.

no.12928 mattressv2 178.137.94.166 2017-09-02 14:30

CBD Gummies Miracle CBD Oil for Sale [url=https://hempgummies.us/]CBD Gummies for sale[/url] CBD Gummies Side Effects CBD gummies CBD Side Effects on Liver <a href="https://hempgummies.us/">CBD Gummies Side Effects</a> CBD Gummies Reviews

no.12922 mattress4m 209.160.112.142 2017-08-30 05:29

best potent cbd oil for dogs with cancer - cbdoil4u.org cbdoil4u [url=https://cbdoil4u.org/]cbd oil for pain relief - cbdoil4u.org[/url] cbd oil for pain - cbdoil4u.org how much cbd oil for dogs with cancer - cbdoil4u.org cbd oil side effects stomach - cbdoil4u.org <a href="https://cbdoil4u.org/">benefits of cbd oil for cancer - cbdoil4u.org</a> https://cbdoil4u.org

no.12916 afrsar777 188.235.130.34 2017-08-29 16:30

Хотели бы разнообразить вашу сексуальную жизнь? Добиться принципиально новых ощущений позволят игрушки для взрослых Один из самых востребованных методов достичь сильных ощущений – <a href="https://afroditalove.ru/category/vibromassazher-vibrator/">купить вибратор</a>. С его помощью просто добиться стимуляции эрогенных зон. Только не пользуйтесь им в одиночку, доверьтесь своей второй половине. Это укрепит вашу эмоциональную и физическую связь и поможет стать более открытыми и раскованными др

no.12912 donnaTip 46.161.9.41 2017-08-27 01:26

Few days ago i read new amazing knowledge about Omega 3 foods and now i very wanna purchase it. But i want a best, some premium omega 3 fish oil. I've found this [url=https://www.omega-3.club/premium-fish-oil-carlson.html] premium omega 3 fish oil [/url] link. What do you think about Carlson name?

no.12908 rexong 178.49.154.82 2017-08-23 05:53

Топовые БЕСПЛАТНЫЕ игры для Взрослых вас ожидают все игры онлайн на https://vk.com/porno_flash_games P.S. - ЗАХОДИТЕ И ИГРАЙТЕ в порно флеш ИГРЫ БЕЗ РЕКЛАМЫ И ВИРУСОВ на https://vk.com/porno_flash_games

no.12900 donnaTip 46.161.9.41 2017-08-17 23:04

Some time ago i learned some interesting info about Omega 3 stuff and now i very want to purchase it. But i want a quality, only premium omega 3 fish oil. I've got this [url=https://www.omega-3.club/premium-fish-oil-carlson.html] premium omega 3 fish oil [/url] link. What do you know about this name?

no.12894 donnaTip 46.161.9.41 2017-08-17 02:19

Some time ago i learned some cool knowledge about Omega 3 stuff and now i very want to buy it. But i want a best, some premium omega 3 fish oil. I've found this [url=https://www.omega-3.club/premium-fish-oil-carlson.html] premium omega 3 fish oil [/url] link. What do you think about Carlson brand?

no.12888 batarbek0tsa 178.76.243.0 2017-08-16 19:04

[b]Авиабилеты по РУ за 60 процентов от цены кассы.[/b] по МИРУ - 50%| [b]Телеграмм @AviaRussia[/b] только этот, другие не используем. Надежно. Выгодно. Без слётов. И БЕЗ каких-либо проблем. Оплата: ЯндексДеньги, Webmoney (профессиональные счета) Рады сотрудничеству! ________ авиабилеты скидки спецпредложения aviobilet com дешевые авиабилеты s7 купить авиабилеты дешево +есть ли скидки +на авиабилеты авиа официальный сайт купить билеты дешево

no.12883 vladmir3xk 178.76.243.0 2017-08-16 00:42

[b]Пополение баланса Авито (Avito) за 50%[/b] | [b]Телеграмм @a1garant[/b] [b]Здравствуйте, дорогие друзья![/b] Рады будем предоставить Всем вам сервис по пополнению баланса на действующие активные аккаунты Avito (а также, абсолютно новые). Если Вам необходимы конкретные балансы - пишите, будем решать. Потратить можно на турбо продажи, любые платные услуги Авито (Avito). [b]Аккаунты не Брут. Живут долго.[/b] Процент пополнения в нашу сторону и стоимость готовых аккаунтов: [b

no.12880 donnaTip 46.161.9.41 2017-08-14 14:50

Day ago i got some amazing info about Omega 3 foods and now i really wanna get it. But i'm not absolutely sure which pluses will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i want to purchase it with best price. Any idea?

no.12875 donnaTip 46.161.9.41 2017-08-13 21:00

Yesterday i read some amazing info about Omega 3 foods and now i really wanna buy it. But i'm not absolutely sure which benefits will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and currently i want to buy it with good price. Any idea?

no.12870 donnaTip 46.161.9.41 2017-08-13 04:06

Yesterday i got some shocking info about Omega 3 stuff and now i very wanna buy it. But i'm not absolutely sure which pluses will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and currently i wanna buy it with best price. Any idea?

no.12865 donnaTip 46.161.9.41 2017-08-12 11:53

Day ago i got some amazing info about Omega 3 foods and now i very wanna get it. But i'm not 100% sure which pluses will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and currently i wanna get it with good price. Any idea?

no.12859 leeanngep 93.170.187.48 2017-08-11 21:57

Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil": captcha regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another size-types of captcha, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms. Interested? There are a lot of introducing videos about XEvil in YouTub

no.12856 donnaTip 46.161.9.41 2017-08-11 18:53

Day ago i got some interesting info about Omega 3 foods and now i very wanna buy it. But i'm not absolutely sure which pluses will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i want to buy it with best price. Any idea?

no.12848 leeanngep 93.170.187.48 2017-08-11 03:21

Revolutional update of SEO/SMM software "XRumer 16.0 + XEvil": captcha recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another categories of captchas, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms. Interested? There are a lot of demo videos about XEvil in YouTube. You

no.12846 donnaTip 46.161.9.41 2017-08-11 02:38

Yesterday i read some interesting info about Omega 3 foods and now i really wanna get it. But i'm not really sure which benefits will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and currently i wanna buy it with good price. Any idea?

no.12839 leeanngep 93.170.187.48 2017-08-10 22:08

Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil": captchas recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another categories of captchas, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms. Interested? You can find a lot of demo videos about XEvil in YouTube.

no.12836 donnaTip 46.161.9.41 2017-08-10 10:48

Yesterday i read some interesting info about Omega 3 foods and now i really wanna get it. But i'm not really sure which benefits will i have. I've got this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i want to get it with best price. Any idea?

no.12831 donnaTip 46.161.9.41 2017-08-09 18:06

Day ago i got some amazing info about Omega 3 stuff and now i really wanna get it. But i'm not really sure which benefits will i have. I've got this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i want to purchase it with lowest price. Any idea?

no.12826 donnaTip 46.161.9.41 2017-08-09 00:54

Day ago i got some interesting info about Omega 3 foods and now i really wanna buy it. But i'm not 100% sure which benefits will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and currently i want to purchase it with best price. Any idea?

no.12821 donnaTip 46.161.9.41 2017-08-08 09:06

Yesterday i read some amazing info about Omega 3 stuff and now i very wanna get it. But i'm not really sure which pluses will i have. I've got this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i want to purchase it with good price. Any idea?

no.12816 donnaTip 46.161.9.41 2017-08-07 16:56

Day ago i read some interesting info about Omega 3 stuff and now i very wanna buy it. But i'm not really sure which benefits will i have. I've found this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i wanna buy it with lowest price. Any idea?

no.12814 carolynseemn 93.170.187.48 2017-08-07 13:51

Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil 3.0": captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another size-types of captcha, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms. Interested? There are a lot of impessive videos about XEvil in YouTube.

no.12807 carolynseemn 93.170.187.48 2017-08-07 07:58

Revolutional update of SEO/SMM package "XRumer 16.0 + XEvil": captcha breaking of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another subtypes of captchas, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms. Interested? There are a lot of demo videos about XEvil in YouTube. You read

no.12802 carolynseemn 93.170.187.48 2017-08-07 02:21

Revolutional update of SEO/SMM software "XRumer 16.0 + XEvil 3.0": captcha regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another size-types of captcha, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software. Interested? There are a lot of demo videos about XEvil in YouTube. Yo

no.12799 donnaTip 46.161.9.41 2017-08-07 00:04

Yesterday i got some cool info about Omega 3 stuff and now i really wanna buy it. But i'm not absolutely sure which benefits will i have. I've got this [url=https://buy-omega-3.com] omega 3 info [/url] , and now i wanna get it with lowest price. Any idea?

no.12794 carolynseemn 93.170.187.48 2017-08-06 20:54

Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil 3.0": captchas recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex, and more than 8400 another categories of captcha, with highest precision (80..100%) and highest speed (100 img per second). You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software. Interested? You can find a lot of introducing videos about XEvil in

发表评论:

邮箱: