Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center Text in a Box 2

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
US
I'm attempting to create buttons for a website. I'd like to draw a small box (rectangle) and then have text centered both horizonatlly and vertically. I've searched the forum (as well as the Help file) and didn't find any information which is why I'm writing this.

I would assume there's an easy way to do this but I'm unable to figure it out. How can I take a rectangle that I've drawn and put text in it such that it's centered horizontally and vertically?

Thanks in advance for your help, Onwards,

Q-
 
Forgot to mention, I'm using Illustrator 9 Onwards,

Q-
 
Center the text horizontally with the paragraph formatting (CTRL-SHIFT-C or CMD-SHIFT-C). Vertical alignment is done with leading.

If you have created buttons, select each button to expose the 8 control handles, one in each corner and one in each side. Drag guidelines over these side handles. You now have guides to align your text to.
 
Select both of your objects and go to the Align Pallette (Window --> Show Align) and click on "Horizontal Align Center" and "Vertical Align Center".
 
Hey! Thanks! I gave you both a star, although crizak's suggestion was easiest to implement. Maybe I'm just too much of a beginner, but I find it difficult to get two objects to align in the manner that jimoblak describes. One of them usually covers the other so I don't know whether or not I have them covering the same area.

I also found some information in my "Teach Yourself Illustrator in 24 hours book.". I'll reprint it here just for fun:

Code:
1.  Type some text greater in size than 30 pt.
2.  With the text selected, open the Appearance palatte and select the Type Object
3.  Add a new fill by choosing Add New Fill from the pop-up menu.
4.  There are now two fills in your Type Object.  Select the Fill that's lower in the palette or near the bottom.
5.  Choose Effect, Convert to Shape, Rectangle to open the Shape dialog box.
6.  Check the Relative button and set both the Extra Width and Extra Height to 18pt.  Then click OK.
7.  You'll notice in the Appearance palette that the fill now has a shape and color attributte.  Click the Color attribute to highlight it.
8.  In the Color palette, apply any color you might like.  The color rectangle now appears behind the text.
9.  Select your Text tool, highlight the word and change it to something else.  Watch as the color rectangle grows to accomodate the new text.

What I don't know is, if I figure out how to apply different types of Swatches or something to the button whether or not it will work with this procedure, but I know that with crizak's method I'll be able to get it to work.

THANKS!!
Onwards,

Q-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top