Neenoheenna
New Member
Say I have a portion of my HTML file that looks like this:\[code\]<div data-w="20px"> <p>this is some text this is some text this is some text</p></div>\[/code\]And the \[code\]<div>\[/code\]'s width should equal \[code\]data-w\[/code\], as shown below.\[code\]div { width:[data-w]; }\[/code\]I know I can use \[code\][attribute]\[/code\] as a selector, but honestly, this is not an alternative:\[code\]div[data-w=1px]{ width:1px; }div[data-w=2px]{ width:1px; }div[data-w=3px]{ width:1px; }div[data-w=4px]{ width:1px; }div[data-w=5px]{ width:1px; }div[data-w=1px]{ width:1px; }div[data-w=1px]{ width:1px; } (...)\[/code\]Ideas?EditI found a possible duplicate