- Last post
- 22 Responses
I need to have a bunch of divs lined up next to each other horizontally, which then all need to be horizontally centered on a page. I have them next to each other using float:left, but tried putting them centered in a table which isnt working.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<a href="#"><div id="apDiv1">mnbmbnmb</div>
sorry didn't really look at above but try display: inline-block;
^ On the div css? Just tried that, doesnt do anything.
get rid of floats
try putting the href inside the div,
if you add "display: inline-block", you have to remove the "float-left", and the "top:0px".
Need clickable blocks, cant use images in them. Ive had issues trying to get an entire table cell clickable in the past, idk why and Ive had no problems with it with divs.
estetic, in the code that you sent, how do you vertically center the text in the divs? Trying to ad a vertical-align:middle in different places in your code, nothing working.
^ I was talking about the text within the blocks. I need those to be vertically centered within the block. Is that possible?
Ugh, one last thing. I need to have one DIV above this other row of DIVs, just horizontally centered above them. Trying it out myself and the new DIV just insists on left aligning even though the others below it are centering.
youre the man! clearly i suck at this.
Is the code on that that site not updating? I see you added something called id="single", yet I dont see it in the css.
its not used - none of the ID's are, you had them in your example and I kept them.
I changed the behavior of the 'link' class and added a second class to the items that need to be displayed 'inline'.
Sorry man getting confused here. You added a class called .inline, but in the body code its referencing class=link inline. Whats the deal with that?
'link' applies the global styling to the item (makes it a white block, with red hover, controls the positions and span ect) adding inline makes the 4 on the second row display inline. Classes can be stacked and the element will take on the styling following the rules of css specificity
Im very close to being done with this. Only problem im having now is I need each block to be a different color. Running into some issues trying to do that with classes.