SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,644
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    :target height and <em>

    I have two problems with
    http://fixmysite.us/coronadoshores/service/#tab-1

    How can I change the height of each of the content divs so its variable (height depends on whats inside) cause there seems to be no height unless I give the :target a height of 300px;
    Lastly I have 2 <em>son the right side in 2 of the items, how do I make it on a new line (within that span)

    Thanks....
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,200
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by lukeurtnowski View Post
    How can I change the height of each of the content divs so its variable
    Don't think you can. Maybe JS would be a better option.

    Lastly I have 2 <em>son the right side in 2 of the items, how do I make it on a new line (within that span)
    You could use display: block; if you want it fully on a separate line.

    Code:
    span em {display: block;}

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Can't you just set height: auto; on :target instead of a fixed height?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,200
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by CletusSpuckler View Post
    Can't you just set height: auto; on :target instead of a fixed height?
    Dang, I though I tried that and it failed, but indeed it seems to work.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Dang, I though I tried that and it failed, but indeed it seems to work.
    Sounds good I only tried it in Firebug and didn't really look much at the code, so I wasn't sure if you'd already tried it and found that it couldn't be used in this case for whatever reason.

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by CletusSpuckler View Post
    Can't you just set height: auto; on :target instead of a fixed height?
    No you can't do that because then you will lose the transition effect as transitions don't work to auto heights - which perversely is exactly how you want them to work most of the time. It's the same problem I ran into with this demo from a recent quiz.

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Location
    Oskarshamn, Sweden
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    No you can't do that because then you will lose the transition effect as transitions don't work to auto heights - which perversely is exactly how you want them to work most of the time. It's the same problem I ran into with this demo from a recent quiz.
    Ah, I didn't even consider the transitions. Kinda sucks that it can't be done that way

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by CletusSpuckler View Post
    . Kinda sucks that it can't be done that way
    Yes, I don't know what they were thinking as that is the exact behaviour you want most of the time

  9. #9
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,644
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    ok, thanks anyway though
    "Oh, and Jenkins--apparently your mother died this morning."


Bookmarks

Posting Permissions

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