Welcome to WebmasterWorld Guest from 54.159.214.250

Forum Moderators: not2easy

some text to center and others to left

   
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;
}
1:18 pm on Sep 6, 2010 (gmt 0)

10+ Year Member



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.
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
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.
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?
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month