[css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Philip Taylor (Webmaster, Ret'd)
A CMS, over which I have no control, auto-generates a number of the following blocks (with different values for the hrefs, background-images, and the textual content of the innermost A element) : div class=album_box a

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
Since In CSS an element cannot be selected based on its children, I think the only way this can be achieved is by using javascript. On Thu, Dec 2, 2010 at 3:30 PM, Philip Taylor (Webmaster, Ret'd) p.tay...@rhul.ac.uk wrote: A CMS, over which I have no control, auto-generates a number of the

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
Looks like absolute urls are blocked. Try this: div.album_box a[href$=gallery/sandbox-3228] , div.album_box a[href$=gallery/sandbox-3228] + div.album_title , div.album_box a[href$=gallery/sandbox-3228] + div.album_description , div.album_box a[href$=gallery/sandbox-3228] + div.clear_both {

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
There were some mistakes in the selectors, my fault for not testing them first! Anyway, this will work: div.album_box a[href$=gallery/sandbox-3228] , div.album_box a[href$=gallery/sandbox-3228] + div.album_title , div.album_box a[href$=gallery/sandbox-3228] + div.album_title +

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
To target div.album_box when it is the first child element of its parent: div.album_box:first-child { visibility:hidden; } For this to work the markup should be something like this: div class=parent div class=album_boxthis is the first-child of parent, it will be hidden/div div

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
visibility:hidden makes an element invisible, but the element still occupies space. To make an element completely disappear from the flow, use display:none ~C On Thu, Dec 2, 2010 at 4:57 PM, Philip Taylor (Webmaster, Ret'd) p.tay...@rhul.ac.uk wrote: Excellent, now there Chetan : _Sandbox is

Re: [css-d] Visibility: hidden contingent on value of content or href attribute of inner element ?

2010-12-02 Thread Chetan Crasta
The following removes the gap. .album_box { height:auto; max-height:150px; } IE6 does not support max-height so use a conditional comment to specify an IE6-only stylesheet that restores the original height declaration in IE6. ~C On Thu, Dec 2, 2010 at 5:04 PM, Chetan Crasta