'Decreasing spacing between two lines in HTML
HTML n00b here. I can't paste my actual code because it's from work, but basically I have
<p>Some text</p>
<p><a href="SomeSite.com">Some more text</a></p>
and I want those lines to be stacked on top of each other while the rest of the lines on the page maintain their normal spacing between each other.
I tried doing
<p style="padding-bottom: 0px">Some text</p>
<p><a style="padding-top: 0px" href="SomeSite.com">Some more text</a></p>
but that didn't work. It seems like it should work.
Please show me how to do it in proper HTML fashion and explain why my attempt failed.
Solution 1:[1]
use a span tag instead of p tag as p tag will automatically will start in a new line
so you should either use display:inline in css or use a span tag
<span>Some text</span>
<span><a href="SomeSite.com">Some more text</a></span>
I just misunderstood your question,so i have the answer below HTML
<p>Some text</p><br/>
<p><a href="SomeSite.com">Some more text</a></p>
CSS:
p{
display:inline;
}
Solution 2:[2]
Not entirely sure what you mean.
But it sounds like you want a line break, rather than a paragraph.
So...
<p>Sometext<br><a href="#">Some other text</a></p>
The <br> tag is for line breaks.
For more info be sure to checkout w3school: http://www.w3schools.com/html/html_paragraphs.asp It's a great resource for learning web design.
Solution 3:[3]
You can use {line height: some %tage;} property....
like this
line height : 30;
for whatever div or tag you want to use it...
please upvote me this is my first ever answer on stackoverflow
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | |
| Solution 3 | Anurag Suryawanshi |
