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

CSS Forum

    
some text to center and others to left
csslearner18




msg:4197134
 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;
}

 

alias




msg:4197143
 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.

csslearner18




msg:4197162
 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

Major_Payne




msg:4197298
 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.

csslearner18




msg:4200502
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved