I have a few div
s which makes a little bit too spacey between the footer and the body. So i want to convert one div to a span. But when I do that, it messes the footer's content a bit up.
How can i do this and keep the styles that already have been defined for the footer?
Thanks in advance!
Edit
div.footer { width: 986px; margin: 0 auto; padding-bottom:18px; border: 0; text-align: left; color:#000000; }
You can use the HTML span tag as a container to group inline elements together so you can style or manipulate them with JavaScript.
It should be used only when no other semantic element is appropriate. <span> is very much like a <div> element, but <div> is a block-level element whereas a <span> is an inline element.
As you already know, the difference between a <div>
and a <span>
is just that one defaults to display:block;
and the other to display:inline;
. To make one act as the other, just set the display style to the other type.
However, you already said you tried this and it didn't achieve the effect you were looking for. There is another display property, which is less well known, but provides a half-way house between the two:
display:inline-block;
What it does is display it inline, but still with block-like properties. (This is basically how an <img>
tag works by default).
Could this be the answer you're looking for?
To convert a div to a span, simply add:
.myDiv { display: inline; }
But I'm really not sure that this is the solution you're after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With