Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
Like Tree2Likes
  • 2 Post By djitsz

Thread: difference: clear:both and overflow:hidden ?

  1. #1
    Senior Member graphicnerd's Avatar
    Join Date
    Nov 2013
    Posts
    196
    Member #
    37739
    Liked
    1 times

    difference: clear:both and overflow:hidden ?

    difference: clear:both and overflow:hidden

    could you tell me what is the difference between the two, overflow when padding from above the header stops flowing down the div below? and clear:both? like position relative?

  2.  

  3. #2
    Member djitsz's Avatar
    Join Date
    Jan 2014
    Posts
    67
    Member #
    38199
    Liked
    17 times
    These two CSS attributes have a very different function. Clear:both is for clearing floating elements, i.e., if you have an element and you want to make sure that other elements cannot float to the left or right side of that element, you use "clear:both" to prevent these other elements from surrounding the element.

    Overflow: hidden is to hide content which expands beyond the size of the element on which it is applied. For instance, if you have a div element and you set the size to width:100px and height:100px and overflow:hidden, when you then put an image of 200px x 200px within that div element, only the part of the image that fits within the 100px x 100px is shown.
    graphicnerd and AlphaMare like this.

  4. #3
    Senior Member graphicnerd's Avatar
    Join Date
    Nov 2013
    Posts
    196
    Member #
    37739
    Liked
    1 times
    Quote Originally Posted by djitsz View Post
    These two CSS attributes have a very different function. Clear:both is for clearing floating elements, i.e., if you have an element and you want to make sure that other elements cannot float to the left or right side of that element, you use "clear:both" to prevent these other elements from surrounding the element.

    Overflow: hidden is to hide content which expands beyond the size of the element on which it is applied. For instance, if you have a div element and you set the size to width:100px and height:100px and overflow:hidden, when you then put an image of 200px x 200px within that div element, only the part of the image that fits within the 100px x 100px is shown.
    could you edit it here , clear:both and overflow:hidden

    CSSDesk - 8tufR

  5. #4
    Member djitsz's Avatar
    Join Date
    Jan 2014
    Posts
    67
    Member #
    38199
    Liked
    17 times
    Not sure what you're asking. What are you trying to achieve?

  6. #5
    Senior Member graphicnerd's Avatar
    Join Date
    Nov 2013
    Posts
    196
    Member #
    37739
    Liked
    1 times
    Quote Originally Posted by djitsz View Post
    Not sure what you're asking. What are you trying to achieve?
    to understand overflow:hidden and clear:both , sorry for being so dumb, thanks for the help


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:42 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com