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
https://forums.phpfreaks.com/topic/183991-justify/#findComment-971406
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
https://forums.phpfreaks.com/topic/183991-justify/#findComment-971422
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
https://forums.phpfreaks.com/topic/183991-justify/#findComment-972588
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
https://forums.phpfreaks.com/topic/183991-justify/#findComment-972910
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.