شما اینجا هستید

ویژگی float مشخص میکند که یک عنصر باید شناور شود یا خیر و ویژگی clear برای کنترل رفتار عناصر شناور به کار گرفته میشود.

ویژگی flaot

فراگیرترین استفاده از ویژگی float، نمایش متن در کنار تصویر است. ویژگی float دارای مقادیر right, left و none است.

مثال پایین یک تصویر که در سمت راست یک متن شناور شده است را نمایش میدهد:

<html>

<head>

<style>

img {

    float: right;

    margin: 0 0 10px 10px;

}

</style>

</head>

<body>


<p>In this example, the image will float to the right in the paragraph, and the text in the paragraph will wrap around the image.</p>


<p><img src="puyapardaz.jpg" alt="puyapardaz.ir" width="100" height="140">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Mauris ante ligula, facilisis sed ornare eu, lobortis in odio. Praesent convallis urna a lacus interdum ut hendrerit risus congue. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. Cras ac leo purus. Mauris quis diam velit.</p>


</body>

</html>

ویژگی clear

 

ویژگی clear برای کنترل رفتار عناصر شناور به کار میرود. عناصری که بعد از عنصر شناور هستند در اطراف عنصر شناور نمایش داده میشوند. برای جلوگیری از این وضعیت از ویژگی clear استفاده میکنیم. ویژگی clear دارای مقادیر both, left, right و none میباشد.

ویژگی clear مشخص میکند که کدام طرف از عناصر شناور اجازه شناور بودن را نداشته باشند:

<html>

<head>

<style>

.div1 {

    float: left;

    width: 100px;

    height: 50px;

    margin: 10px;

    border: 3px solid #8AC007;

}


.div2 {

    border: 1px solid red;

}



.div3 {

    float: left;

    width: 100px;

    height: 50px;

    margin: 10px;

    border: 3px solid #8AC007;

}


.div4 {

    border: 1px solid red;

    clear: left;

}

</style>

</head>

<body>


<h2>Without clear</h2>

<div class="div1">div1</div>

<div class="div2">div2 - Notice that the div2 element is after div1, in the HTML code. However, since div1 is floated to the left, this happens: the text in div2 is floated around div1, and div2 surrounds the whole thing.</div>


<h2>Using clear</h2>

<div class="div3">div3</div>

<div class="div4">div4 - Using clear moves div4 down below the floated div3. The value "left" clears elements floated to the left. You can also clear "right" and "both".</div>


</body>

</html>

 

هک سرریز – ;overflow: auto

 

اگر یک عنصر بزرگتر از عنصر نگهدارنده اش باشد و همچنین شناور باشد از کادر عنصر نگدارنده اش بیرون میزند به این حالت سرریز شدن میگویند که آن را میتوانیم توسط ویژگی overflow کنترل کنیم. برای اینکار ;overflow: auto را به عنصر نگهدارنده اضافه میکنیم تا مشکل سرریز شدن برطرف شود:

<html>

<head>

<style>

div {

    border: 3px solid #8AC007;

}


.img1 {

    float: right;

}


.clearfix {

    overflow: auto;

}


.img2 {

    float: right;

}

</style>

</head>

<body>


<p>In this example, the image is taller than the element containing it, and it is floated, so it overflows outside of its container:</p>


<div><img class="img1" src="puyapardaz.jpg" alt="puyapardaz.ir" width="100" height="140">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum...</div>


<p style="clear:right">Add a clearfix class with overflow: auto; to the containing element, to fix this problem:</p>


<div class="clearfix"><img class="img2" src="puyapardaz.jpg" alt="puyapardaz.ir" width="100" height="140">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum...</div>


</body>

</html>

 

ویژگی overflow دارای مقادیر visible, hidden, auto و scroll میباشد.

 

نمونه از صفحه آرایی وب

تقریباً در همه صفحه آرایی ها در وب از ویژگی float استفاده میشود:

<html>

<head>

<style>

div {

    border: 3px solid blue;

}


.clearfix {

    overflow: auto;

}


nav {

    float: left;

    width: 200px;

    border: 3px solid #8AC007;

}


section {

    margin-left: 206px;

    border: 3px solid red;

}

</style>

</head>

<body>


<div class="clearfix">


<nav>

  <span>nav</span>

    <ul>

      <li><a target="_blank" href="puyapardaz.ir ">Home</a></li>

      <li><a target="_blank" href=" puyapardaz.ir ">CSS</a></li>

      <li><a target="_blank" href=" puyapardaz.ir ">HTML</a></li>

      <li><a target="_blank" href=" puyapardaz.ir ">JavaScript</a></li>

    </ul>

  </nav>


  <section>

    <span>section</span>

    <p>Notice we have put a clearfix on the div container. It is not needed in this example, but it would be if the nav element was longer than the non-floated section content.</p>

  </section>


  <section>

    <span>section</span>

    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet.</p>

  </section>


</div>


</body>

</html>

 

دیدگاه‌ها

online viagra presciption do any medicare plans help pay for viagra viagra buy do you need a prescription for viagra republicans received more viagra

viagra coupon for 2017 safe site to order viagra how long does viagra last how to use viagra #ИМЯ?

https://viagrnetwork.com/# - viagra 100mg

quick small personal loans quick loans under 500 quick loans faxless quick payday loans quick cash loans broken arrow

quick payday loans wichita ks quick and loans quick loans quick cash loans no credit check reviews quick and easy loans online

quick and loans rates quick personal loans online quick loans quick loans for small business quick online business loans

www.american.bank/loans#loan-quick-pay quick business loans for startups quick loan quick and easy personal loans online quick and easy business loans

loans quick does quick and loans have wifi quick loans quick loans for millenials quick personal loans

quick online payday loans online quick cash loans quick loans quick small personal loans does quick and loans have wifi

https://paydailoanz.com/# - quick loans

how did tom steyer make his money how to make money as a kid make money free ways to make money online how to make money fast

how to make money selling drugs make extra money from home make money how to make money without a job how to make money online

https://make-money-blogs.com/# - work from home

how does robinhood make money how much money can you make on disability work from home easy way to make money how to make money blogging

how did betsy devos make her money how did tom steyer make his money work from home legit ways to make money online how to make more money

https://make-money-blogs.com/# - work from home

make money fast how do you make money on youtube make money photos imgclick easily make money sharing will friends social free file upload how to make quick money

easy ways to make money online make money now instant payout work from home apps to make money how to make money with a website

https://make-money-blogs.com/# - make money

make money now instant payout how to make money on amazon work from home money make how to make extra money

how much money can you make on youtube make money online free make money how do youtubers make money how do you make money on youtube

https://make-money-blogs.com/# - work from home

how to make money online how to make extra money from home work from home make money apps legitimate ways make extra money

how to make money on amazon make money online fast work from home how much money does pewdiepie make make money now

http://yogin108.ru/ - work from home

how do you make money on youtube make money on youtube work from home how to make money with youtube best way to make money online

how do youtubers make money make real money online work from home make money online surveys how much money does pewdiepie make

http://euroflower.ru/ - work from home

imgclick will easily make money sharing photos friends social free file upload make extra money work from home make money fast make money on facebook

make money now instant payout how did mark cuban make his money make money how much money does pewdiepie make how did george soros make his money

http://simapr.ru/ - make money

best way to make money apps to make money make money how do youtubers make money how did george soros make his money

imgclick will easily make money sharing photos friends social free file upload how does robinhood make money make money how to make money on the internet how did jerry jones make his money

http://yurevo55.ru/ - make money

legit ways to make money online make money fast work from home how much money can you make on disability how to make money on twitch

how do you make money on youtube how to make money on instagram work from home how to make money online from home how to make money fast

http://livestarina.ru/ - work from home

free casino games online http://onlinecasinogamespcx.com/ - online casino slots casino blackjack play slots online

online gambling vegas casino slots play casino play slots http://onlinecasinogamespcx.com/ - no deposit casino

slots for real money free casino casino online slots free casino http://onlinecasinosw.com/ - online gambling

vegas casino slots free online slots free casino slot games online casino games http://onlinecasinosw.com/ - gold fish casino slots

online slots play slots slot games

free slots http://onlinecasinogamespcx.com/ - online gambling cashman casino slots free online slots

slots games http://onlinecasinosw.com/ - play slots slots for real money online casino bonus

http://onlinecasinogamespcx.com/ casino online slots free casino games online vegas slots online play slots

free slots slots games free slots games

online casino gambling play casino casino real money best online casinos

big fish casino free online slots casino online online casino slots http://onlinecasinosw.com/ - online casino gambling

http://onlinecasinopc.com/ cashman casino slots online slots online casino real money free casino

free casino games slots games real casino slots play slots http://onlinecasinosw.com/ - slots games free

gold fish casino slots vegas slots online slots free real money casino [url=http://onlinecasinopc.com/ ]vegas casino slots [/url]

free casino slot games http://playcasinosw.com/ casino online slots free casino games online gold fish casino slots

http://onlinecasinopc.com/ world class casino slots slots games free casino blackjack casino online slots

http://playcasinosw.com/ casino online slots [url=http://playcasinosw.com/ ]free casino games online [/url] online slot games

free casino slot games free casino play casino casino blackjack

big fish casino slots games free no deposit casino slot games [url=http://onlinecasinopc.com/ ]casino online slots [/url]

free online slots online slot games cashman casino slots play casino [url=http://playcasinosw.com/ ]free casino games online [/url]

casino bonus codes gold fish casino slots free casino games casino games [url=http://onlinecasinopc.com/ ]online casino bonus [/url]

http://playcasinosw.com/ online casinos [url=http://playcasinosw.com/ ]casino online [/url] online casinos

http://onlinecasinopc.com/ online casino real money [url=http://onlinecasinopc.com/ ]play slots online [/url] online casino

http://playcasinosw.com/ free slots vegas casino slots online casino bonus online casino

online casino gambling casino slots real money casino slots free

http://playcasinosw.com/ cashman casino slots [url=http://playcasinosw.com/ ]slot games [/url] no deposit casino

online gambling real money casino free casino slot games casino slots

http://casinoplaysw.com/ slots free big fish casino play casino real money casino

online casino games online slot games casino bonus codes

http://casinoplaysw.com/ cashman casino slots online casino slots online casinos gold fish casino slots

free casino games online free casino free casino slot games

free casino play slots play online casino online casino slots

http://casinoslotspc.com/ play slots online [url=http://casinoslotspc.com/ ]play online casino [/url] no deposit casino

best online casinos play slots online free slots games gold fish casino slots

صفحه‌ها

افزودن دیدگاه جدید

دیدگاه

  • تگ‌های HTML مجاز: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.

Plain text

  • تگ‌های HTML مجاز نیستند.
  • نشانی صفحه‌ها وب و پست الکترونیک بصورت خودکار به پیوند تبدیل می‌شوند.
  • خطوط و پاراگراف‌ها بطور خودکار اعمال می‌شوند.
كد امنيتي
این پرسش برای جلوگیری از ارسال اسپمهای اتوماتیک است.