center middle of three spans
-
Greetings, I have three spans wrapped in a div. Each of the spans can contain a link. I always want the middle span to be centered in the outer div. The problem comes because the left and right most links are not always there, though the span will be. Basically it's to move forward and back in a date range if data is available. If the data is not available, the previous and next links should not be shown. The setup is similar to this: <pre><div> <span>Prev link</span><span>detail link</span><span>next link</span> </div></pre> I've played around with float left and right and center alignments, but the center span either gets moved to the next line, or the link shows right after the first span. If anyone has any ideas it would be much appreciated. Thanks.
-
Greetings, I have three spans wrapped in a div. Each of the spans can contain a link. I always want the middle span to be centered in the outer div. The problem comes because the left and right most links are not always there, though the span will be. Basically it's to move forward and back in a date range if data is available. If the data is not available, the previous and next links should not be shown. The setup is similar to this: <pre><div> <span>Prev link</span><span>detail link</span><span>next link</span> </div></pre> I've played around with float left and right and center alignments, but the center span either gets moved to the next line, or the link shows right after the first span. If anyone has any ideas it would be much appreciated. Thanks.
Hi Just try the following:
<pre>
<div style="text-align:center" >
<span style="float:left" >Prev link</span>
<span>detail link</span>
<span style="float:right" >next link</span>
</div>
</pre>Thanks, Imdadhusen
sunaSaRa Imdadhusen +91 99095 44184
-
Greetings, I have three spans wrapped in a div. Each of the spans can contain a link. I always want the middle span to be centered in the outer div. The problem comes because the left and right most links are not always there, though the span will be. Basically it's to move forward and back in a date range if data is available. If the data is not available, the previous and next links should not be shown. The setup is similar to this: <pre><div> <span>Prev link</span><span>detail link</span><span>next link</span> </div></pre> I've played around with float left and right and center alignments, but the center span either gets moved to the next line, or the link shows right after the first span. If anyone has any ideas it would be much appreciated. Thanks.
you could try setting the visible of the Prev and Next links rather than not putting them there. This was they will always be there and take up the same amount of space (even if they cannot be seen) <pre><div> <span style="visibility:hidden;">Prev link</span><span>detail link</span><span>next link</span> </div></pre>
Don't vote my posts down just because you don't understand them - if you lack the superior intelligence that I possess then simply walk away