Welcome to WebmasterWorld Guest from 54.163.49.19

Forum Moderators: not2easy

Message Too Old, No Replies

some text to center and others to left

     
12:18 pm on Sep 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 6, 2010
posts: 5
votes: 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 Sept 6, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 5, 2004
posts:198
votes: 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.
2:30 pm on Sept 6, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 6, 2010
posts:5
votes: 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 Sept 6, 2010 (gmt 0)

Full Member

joined:July 31, 2005
posts:272
votes: 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 Sept 11, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 6, 2010
posts: 5
votes: 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?