Jump to content

[SOLVED] Paragraphs next to each, not on a new line


alex3

Recommended Posts

At the top of my site I have a nav bar with links. These are just <a></a> tags all next to each other with some style defined in a CSS file (a bit of a margin to separate them horizontally a bit more). In the footer, I want a similar style of text, but they aren't hyperlinks.

 

What I need to know is what tag to use. The <p> tag will create a new line if I create another paragraph, but I want these separate bits of text of spaced horizontally (i.e. I want them all on one line). How do I go about this with out one big <p> with loads of spaces in it?

Link to comment
Share on other sites

So you want something like:

 

blah blah blah    blah blah blah    blah blah blah

blah blah blah    blah blah blah    blah blah blah

blah blah blah    blah blah blah    blah blah blah

 

Why can't you just create a table with each paragraph being in a separate column while in the same row?

Link to comment
Share on other sites

How is it I use CSS to style spans within a div? I remember doing it a long time ago, can't remember now. So that if I have <div id="something">, every span under something has a specific class, so I don't have to add class="someclass" to every span tag. It's something like #something.span, but I'm not sure.

Link to comment
Share on other sites

you can get rid of the new line behaviour in more than one way, like floating the li's, or setting the display property to inline instead of list.

 

Question is, if you disable the style would the information make more sense as a list or as a bunch of space separated text, making it a sentence.

Link to comment
Share on other sites

I'd set a DIV wrapper to the width I want then an inside wrapper to float left and set to half the width of the wrapper. That way you can write out as many secondary DIVs as you want and everything will line up nicely.

div#main_wrapper {
  width: 600px;
}
div#inside {
  width: 300px;
  float: left;
}

 

Now the HTML...

<div id="main_wrapper">
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
  <div id="inside">stuff here</div>
</div>

 

That will result in:

stuff here                               stuff here
stuff here                               stuff here
stuff here                               stuff here
stuff here                               stuff here

Link to comment
Share on other sites

Ahh got it. Axeia's solution works quite well. I was having problems before I realised Safari was applying it's own style to the ul, so I had to declare no margins for it and no padding-left. Thanks very much for the help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.