www.webdeveloper.com
Results 1 to 6 of 6

Thread: Make an element "not-occupying" space

  1. #1
    Join Date
    Jan 2013
    Posts
    84

    Lightbulb Make an element "not-occupying" space

    Imagine that i want to create a background image without set it into the html,body rules, but declaring it as a <div>
    The problem is that this div will occupy the entire page and subsequent elements will go under it (out of page). So, it's would useful to make the background a "not-occupying" element, so that other elements can use his space.

    There is a special rule in the css for do that? Hiding an element, it's possibile to set "display:none" rule, but is it possibile to do a similiar thing with the element regularly displayed?

  2. #2
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    Of course not it would be totally illogical. You either display or you don't if it is a background, the set it as the background; otherwise you are just wasting your time trying to re-invent CSS.
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

  3. #3
    Join Date
    Jan 2013
    Posts
    84
    i've done the exemple with background for take an "extreme" situation, with an element that occupy the entire page..

  4. #4
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    The example is irrelevant. What you are asking for is not logical. An element cannot be in two mutually exclusive states at the same time. It either displays or it does not. If it displays then it must either be the background for a declared entity or the content of a declared entity.

    It is a waste of time to explore it any further.
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

  5. #5
    Join Date
    Jan 2013
    Posts
    84
    So, for overlap elements it's only possible to set it in an absolute position?

  6. #6
    Join Date
    Aug 2012
    Location
    Canada
    Posts
    56
    absolute or fixed.
    Cd&
    one of my toys And my repository and my old self ranting plus a bonus Getting the most out of Q/A sites
    Code that is 100% standards compliant is 100% correct 100% of the time... anything else is just a hack

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles