homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

some text to center and others to left

Msg#: 4197132 posted 12:18 pm on Sep 6, 2010 (gmt 0)

Hi there,
I want some text to align left and others to align justify within my right colum paragraph.

please give me an advice what's the best way to do.
Currently all the texts are aligned to left.

div#main-content div#right-col {
float: left;
margin: 0 0 0 235px;
width: 565px;

div#main-content div#right-col p {
font-size: 1.0em;
margin-bottom: 0.8em;



10+ Year Member

Msg#: 4197132 posted 1:18 pm on Sep 6, 2010 (gmt 0)

Welcome to Webmasterworld, csslearner18.

Within the paragraph? You mean, you've got a single <p> of text and you want some text to be aligned differently?

It looks like a dirty trick, in that case, but there's no other way of doing it, other than wrapping the bit o text you want to customize with a <span>, and add { display: block; text-align: justify; } to that span.

Hope that helps.


Msg#: 4197132 posted 2:30 pm on Sep 6, 2010 (gmt 0)

Hi alias,
Yes! it worked:)

But there was another major problem I found...
I will post another new topic right now


Msg#: 4197132 posted 9:16 pm on Sep 6, 2010 (gmt 0)

Just keep in mind that browsers' default is to align left unless styled to do otherwise. Should make it easier to get the justify condition for the text you want.

Curious as to what problem you could have ended up with using alias' method.


Msg#: 4197132 posted 1:53 pm on Sep 11, 2010 (gmt 0)

I need another help on this.
My client actually asked to do align text like below:
texttexttexttexttexttexttexttexttexttexttexttext (1)
texttexttexttexttexttexttexttexttexttexttexttext (1)
texttexttexttexttexttext (2)
texttexttexttexttexttext (2)
texttexttexttexttexttexttexttexttexttexttexttext (1)
texttexttexttexttexttext (2)
texttexttexttexttexttexttexttexttexttexttexttext (1)
texttexttexttexttexttexttexttexttexttexttexttext (1)
texttexttexttexttexttext (2)

Now if I use alias method, I could create (1) withoutany problems.
But if I want to align (2), all I could think was to use <p class="2">.

The CSS I used was
.2 {width: 40%;}

Then it creates unnecessary line spacing...

Any solutions on this?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved