Click to See Complete Forum and Search --> : newbie question on aligning


linkedit
01-27-2010, 07:05 PM
I have a question on the proper html commands to align for objects. I have scripts for 100px ad boxes that I'm trying to place in my blog. I can put them in a html text widget. The problem is that I'm trying to align all four so that are in a square shape (2 rows, 2 on top, 2 on the bottom) I tried the ALIGN code for left and right but that doesn't allow me to put one left and one right on the same line.

Any help is appreciated.

Mark

skywalker2208
01-27-2010, 08:56 PM
If you can use css then use float: left. If not then you probably would have to do it with a table.

aj_nsc
01-27-2010, 09:07 PM
This is always a good bet:


<ul>
<li>first block</li>
<li>second block</li>
<li>third block</li>
<li>fourth block</li>
</ul>



ul { width: 250px; }
li { list-style-type: none; float: left; height: 100px; width: 100px; margin: 10px 25px 10px 0; border: 1px solid #000; display: block; }


Should give you the desired effect you are looking for.

linkedit
01-28-2010, 12:13 AM
This is always a good bet:

[html]
<ul>
<li>first block</li>
<li>second block</li>
<li>third block</li>
<li>fourth block</li>
</ul>

that aligned the 4 boxes vertically in a line.

aj_nsc
01-28-2010, 06:35 AM
My bad, try changing this:


ul { width: 275px; border: 1px solid #000; overflow: hidden; }


The last two parts of the above rule show you what the container for the li's actually looks like so you can change the width as needed and actually see the results. Simple set the border width to 0 when displaying it live on your site.

linkedit
02-03-2010, 11:01 AM
I ended up setting it up as a table. Which worked.

aj_nsc
02-03-2010, 07:23 PM
I ended up setting it up as a table. Which worked.

Welcome to three-five years ago in the world of web design.