Jump to content

Justify


M.O.S. Studios

Recommended Posts

Then you would have to find the longest of all the items and adjust the letter spacing of all the rest based on their length.  Thats just alot of work that would most likely break the moment someone increased their text size in the browser. 

 

If your just doing this for looks then why not do something like float an icon to the right side of each item.  Then even though the letters aren't lining up the icons would be and it would look nice.

Link to comment
Share on other sites

wont really work with the design

 

basically i want the M in members and the P in products to start at the left corner of the black box under them

 

and the S in members and PRODUCTS to end at the right corner of the box under them.

 

 

here is the code

 

basicly i want the

 

html

	<div class="side_bar">
		<div class='bgside'>
			<span class='title'>
				MEMBERS
			</span>
			<div class='right_content'>
				E-MAIL:<br><input type='text' size='15' maxlength='25'><br>
				PASSWORD:<br><input type='password' size='15' maxlength='25'>
			</div>
		</div>

		<div class='bgside'>
			<span class='title'>
				PRODUCTS
			</span>
			<div class='right_content'>
				Games
				Tools
			</div>
		</div>

	</div>

 

css

.side_bar{
   position: relative;
   float: right;
   width: 150px;
   min-height: 800px;
   background: fixed url(../images/bg/side_bg.png);
}

.side_bar .bgside{
   background: #f3a048;
   width: auto;
   margin: 5px 5px 5px 5px;
}

.side_bar .bgside span.title{
   min-height: 20px;
   background: transparent;
   text-align: justify;
   letter-spacing: 
   margin: 0px 5px 0px 5px;
}

.side_bar .bgside .right_content{
   background: #000000;
   width: auto;
   height: auto;
   margin: 0px 10px 10px 10px;
   border-bottom:10px solid #f3a048;
   color: #ffffff;
   font-size: 10px;
   text-align: left;
}

 

im trying to find a js script that can ajust the character spacing.

Link to comment
Share on other sites

If you are absolutely desparate to do this, you can put each letter in a span and work with it from there:

 

<span id="m1">m</span><span id="e1">e</span><span id="m2">m</span><span id="b1">b</span><span id="e2">e</span><span id="r1">r</span><span id="s1">s</span>

 

From there you can adjust the margins on each letter individually.

 

 

Link to comment
Share on other sites

do what haku said as it seems like the best viable solution for all browsers at this time, align the text in all of those spans centrally and set the width to 100% / letters in string, i would use php to loop through the words if i was you as it will genrate the code accordingly if done correctly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.