Jump to content
xisto Community
Sign in to follow this  
Lozbo

Joint Blocks As Table Cells how can i css that?

Recommended Posts

I want some piece of paragraphs to ignore the space between them, and i dont know how to css that, i thought it could be "display:inline" but did not work...

I want this:

<p>text text text </p><p>text text text </p><p>text text text </p>

look like this:

<table border="0" cellpadding="0" cellspacing="0"><tr><td>text text text</td></tr><tr><td>text text text</td></tr><tr><td>text text text</td></tr></table>

So that i can use different background colors for each paragraph, without having to break the design for sake of the parent background (like the body background color or something).

Thanks in advance.

Share this post


Link to post
Share on other sites

Try this:<p>text text text <br>text text text <br>text text text <br></p>or this<p style="line-height:0.5">text text text<br>text text text <br> text text text <br> </p>or the way you prefer:<p style="line-height:0.5">text text text</p><p style="line-height:0.5">text text text</p><p style="line-height:0.5">text text text</p>I dont know of any other way. You can adjust line height as you wish, but 1px is normal.

Share this post


Link to post
Share on other sites

I certanly know that i can use <br /> to do so, i wanted independent <p>'s with different colors to be united without white space between them, not line breaks. And that "line-height" rule did not work either. Thanks anyway.

Share this post


Link to post
Share on other sites

I certanly know that i can use <br /> to do so, i wanted independent <p>'s with different colors to be united without white space between them, not line breaks

<p class="red">text text text </p><p class="blue">text text text </p><p class="green">text text text </p>/* CSS */p.red, p.blue, p.green { margin: 0; padding: 0; }p.red { background: red; }p.blue { background: blue; }p.green { background: green; }
You might want to have some padding (other than 0) if you want some space around your text.

Share this post


Link to post
Share on other sites

... { margin: 0;... }

182855[/snapback]

Dammit that was it! i swear i tried it! :):) how could i miss it? thanks Tyssen! I would ask a moderator to close this...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.