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?

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?

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.

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.