Jump to content

Is this ok?


iPixel

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.