iPixel Posted March 22, 2011 Share Posted March 22, 2011 I have 24 Div Boxes, and they are all meant to look the same. The style works with the exception of Width and Height. #box_1, #box_2, #box_3, #box_4, #box_5, #box_6, #box_7, #box_8, #box_9, #box_10, #box_11, #box_12, #box_13, #box_14, #box_15, #box_16, #box_17, #box_18, #box_19, #box_20, #box_21, #box_22, #box_23, #box_24 { background-color:#000000; border:1px solid #333333; width:115px; height:115px; padding:0px; margin:4px; display:inline; } <div id="box_1"></div> <div id="box_2"></div> <div id="box_3"></div> <div id="box_4"></div> <div id="box_5"></div> <div id="box_6"></div> <!-- etc.. --> Am i doing anything wrong? Pleas let me know if you need more code. Link to comment https://forums.phpfreaks.com/topic/231349-is-this-ok/ Share on other sites More sharing options...
iPixel Posted March 22, 2011 Author Share Posted March 22, 2011 display:inline-block; did the trick Link to comment https://forums.phpfreaks.com/topic/231349-is-this-ok/#findComment-1190678 Share on other sites More sharing options...
KevinM1 Posted March 22, 2011 Share Posted March 22, 2011 No no no. Make a CSS class for that. That's why classes exist - one rule set for any number of elements. And display:inline-block isn't a real rule, AFAIK. Divs are naturally block elements. If you want them to be placed side-by-side, float them left. Link to comment https://forums.phpfreaks.com/topic/231349-is-this-ok/#findComment-1190801 Share on other sites More sharing options...
cssfreakie Posted March 22, 2011 Share Posted March 22, 2011 No no no. Make a CSS class for that. That's why classes exist - one rule set for any number of elements. And display:inline-block isn't a real rule, AFAIK. Divs are naturally block elements. If you want them to be placed side-by-side, float them left. I second that!your #box1 to #box100000 is madness, classes are the way to go Link to comment https://forums.phpfreaks.com/topic/231349-is-this-ok/#findComment-1190852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.