SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    626
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question Welcome Display Text Box (doesn't look uniform)

    Hello everyone,

    I gave this <p> element an id of welcomestatement. This is its CSS:

    Code:
    #welcomestatement{
    	display:block;
    	background-color:#FF9;
    	text-align:left;
    	padding:20px;
    	margin:auto;
    	width:400px;
    	position:relative;
    	top:10px;
    	text-shadow:1px 1px 1px #000;
    	/*for IE*/
    	filter:alpha(opacity=50);
    	/*standard CSS3*/
    	opacity:0.5;
    }
    Everything is good, but the text appears to be much closer to the left. The words wrap to the next line, and it doesn't look that good!

    Check it out, uploaded at: Atlanta Review Groupô

    Is there a way to clean this up a little bit?

  2. #2
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Everything is good, but the text appears to be much closer to the left.
    Hi, that's just what happens with the default text-align:left; When there's not enough room for another complete word it drops to a new line.

    To get the text to extend all the way left and right you would need to use text-align:justify; That can be just as unsightly though because the spacing between the words is not consistent.

    There is really not much else you can do about it, it's just what happens since each line does not have the same amount of characters.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •