How to center text within image

If you go to http://www.terwax.com/bf2.html , youll see text in the left side. It took me enough time to center the image. Now that i created ap tag within div, i was able to put text but in every browser its different. Below is the code. Please help me find easy way that can center the text within image.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Terwax - Battlefield</title>
<style type="text/css">
body {
     background-color: #333;
     height:inherit;
     width:inherit;
     margin-left: auto;
     margin-right: auto;
     text-align: center;
#apDiv1 {
     position:absolute;
     width:753px;
     height:110px;
     z-index:1;
     left: 286px;
     top: 174px;
     overflow: visible;
     text-justify: auto;
</style>
</head>
<body>
<div>
    <img src="images/import.png" alt="back" width="1288" height="992" align="middle" />
    <div id="apDiv1">Thanks for coming to the site. I am currently working on it. This isn't finished yet and a lot of graphics to come! Keep checking back and if you don't like or like something, make sure to hit me an email at [email protected] .</div>
</div>
<p> </p>
</body>
</html>

Terwax.com wrote:
That code didn't fix the problem
It just moved the text right to the bottom of page. Last time i did this, the text was static. It couldn't be highlighted.
I know there are tutorials, but i just need help with this as i can finish the website. I am doing all the tutorials currently (lynda.com), but its a long way from now and will be happy if someone can help me get the text in the grey box rather than falling out of it.
Try the code below in IE9. It should work if the browser is backwards compliant. I'll be amzed if it doesn't. Unfortunately I don't have IE9 available to test in. Didn't even know it was available. Is it a beta version of the browser which maybe hasn't been fully tested yet?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Terwax - Battlefield</title>
<style type="text/css">
body {
    background-color: #333;
#imageWrapper {
position: relative;
width: 1288px;
margin: 0 auto;
#apDiv1 {
    position:absolute;
    width:753px;
    left: 270px;
    top: 174px;
</style>
</head>
<body>
<div id="imageWrapper">
    <img src="images/import.png" alt="back" width="1288" height="992" align="middle" />
    <div id="apDiv1">Thanks for coming to the site. I am currently working on it. This isn't finished yet and a lot of graphics to come! Keep checking back and if you don't like or like something, make sure to hit me an email at [email protected] .</div>
</div>
</body>
</html>

Similar Messages

  • How to center text in shapes

    how to center text in shapes. specifically circles.  I want text to be centered directly in the middle

    A lot depends on what you mean by centered, the number of lines of text, the actual font, and whether there are descenders.
    Using vertical justification set to centered may or may not work for you, depending on the above factors, as it depends on the baseline, I believe, rather than the acutal glyph dimensions. You could try adding baseline shift, I suppose, to make fine vertical adjustments, or you can bite the bullet and use the old-fashioned method of two frames.

  • Does anyone know how to highlight text within a mac mail message?

    Does anyone know how to highlight text within a mac mail message?

    I can't find that option in Mac Mail's editor.  You can use a more feature rich editor like OpenOffice or Pages to create your message.  Then copy/paste into mail.
    Dan

  • How to align text within an EditText?

    Hello,
    using this simple one as an example:
    var w = new Window('dialog');
    w.preferredSize = [200,100];
    w.et = w.add('edittext', void 0, "Some text");
    w.et.preferredSize.height = 40;
    w.show();
    The "Some text" is placed top-left in the EditText - is it possible to control its alignment, i.e. ['center', 'middle']?
    (just to be clear, I'm not interested in the EditText position within the Window, but just the text within the EditText itself).
    Thank you!
    Davide Barranca
    www.davidebarranca.com

    Davide, use the below example with either left, center, or right.  You have to have the justify line right after the line that creates the edittext box:
    #target photoshop
    var dlg = new Window('dialog','test')
    dlg.txt = dlg.add('edittext',undefined,'this it the text');
    dlg.txt.justify = 'center'
    dlg.txt.size = [200,60]
    dlg.show()

  • HOW TO ADD TEXT TO IMAGES

    how do you add text to images in Aperture?

    the user can superimpose text (inc. metadata) anywhere: on the image, in the border, over both.
    Learn something new every single day...
    Regards
    TD

  • How to extract text and image information from postscript file

    I want to write a programe,and extract text and image information from postscript file using Java.Is it possible? How to extract ?
    Thank!

    First of all, PostScript is not a "text" file. It can and often does contain binary data. Since PostScript streams often contain nested procedures, unless you process the procedure definitions and can "execute" them, you cannot simply "scan" a file to get what you want. No, I can't talk about this in detail since it is quite complex. But Adobe does have the
    PostScript Language Reference Manual on-line for download at
    . Look that over and you will have a fairly healthy respect as to the task involved.
    - Dov

  • Can't vertically center text within a table cell with a picture next to it

    I have a table and each cell has a picture in it (which was "cut" from another part of the document and "pasted" into the cells). Next to it, I typed a few words. I want the words to be centered vertically within the cell. However, everytime I click on the vertical centering in the inspector, it moves the picture and the text remains at the very bottom of the cell. The text is "tied" to the picture. I've tried everything... highlighting the text, same thing. Can't figure it out!! Is there any way to do this without inserting text boxes??

    Vertical align works on text within text boxes and within table cells.
    I have just checked this using a table with:
    *1st cell* Inline Picture with caption under. Cell sizes to fit
    *2nd cell* Same as first, picture scaled down. Text and image centre vertically.
    *3rd cell* Caption only, vertically centred.
    It works and I have wrap turn off on the image, before I pasted it in.
    On rereading the O.P.'s post it seems to be saying contradictory things. That the text is "tied to the picture" which is what you would expect of inline graphics and that the text is stuck in the bottom the cell.
    Without a picture and a better description of the problem we are none the wiser.
    I am just guessing but perhaps the O.P. has the image and Inline graphic on the same line and can't understand why the bottom of the text and the bottom of the image are aligned.
    If this is the case it is a misunderstanding of what inline graphic means. The image acts just like a character in the text and sits on the text baseline, it is not an independent object.
    It is possible to shift text next to the image or the image itself by selecting either and altering:
    +Inspector > Text > More > Baseline Shift+
    But frankly you would be better separating the 2 and putting the text in the cell to the left or right of the image.
    Peter

  • How to center text in Pages to show correctly on iBook Reader

    Hi,
    First, I have to say that I posted the same question on ''Creating ePubs'' discussioun page but nobody could help.
    I am trying something really easy but could not solve it. Hope someone can help.
    Ok, I know that if I choose ''Chapte Name'' as a pharagraph style, iBook reader automatically puts it into a new page, so the new page starts with the chapter name on top. I dont have any problems with my chapters.
    However, I want my book to start with a page that has a brief info about the author. I want this info in the middle of the page (also centered in the middle). Than I want to go to the second page with a ''dedication'' part where I write my thanks to people. I also want this in the middle and centered. And finally I want to add my book title and author name together on the 3rd page. After that the chapters will start.
    So, as I told you, the chapters work just fine. But when I try to center the text in the first 3 pages, (I press return several times on my keybord to do it) the pages interwine with each other. For example, the last part of page 2 goes on top of page 3.
    I think this happens because I press the return key to center the texts. So, is there a way to lock texts to the pages where they belong to prevent them to interwine with other pages even if I press return to center the text
    OR
    Is there another way to center text to prevent them to interwine with other pages...
    Thank you

    One of the consequences of working all night on this was that there is errata, or improved insight.
    As I mentioned previously, each of the four document parts that I tested is in its own section. This means that each of the first three document icons, in thumbnail view, has its own distinct yellow race track around it. The chapter/body text is in a fourth multi-page section.
    On the first page, with invisibles and layout mode shown, I have a ¶ (pilcrow) showing on line 1, column 1. If I place the cursor before this mark, the text inspector shows the following:
    Style is body
    Character spacing is 0%
    Line spacing is single (1)
    Before paragraph is set to 172 pt.
    After paragraph is set to 6 pt.
    Now, if I place the cursor before the About the Author string:
    Ruler set to 1.6 inches
    Style is Heading 1
    Character spacing is 0%
    Line Spscing is single (1)
    Before paragraph is set to 196 pt
    After paragraph is set to 6 pt
    Place cursor between end of Author and Pilcrow and press return.
    With the cursor before the author description:
    Style is body
    My font choice was Baskerville, Regular 12 pt.
    Left ruler set to 1.6 inches. Right ruler to 6.2 inches.
    Character spacing is -4%
    Line-height is set at multiple (1.2)
    Before paragraph is 0
    After paragraph is 12 pt.
    Position cursor between last character and pilcrow - press return.
    Insert section break
    This is all there is too my first page:
    For the Dedication page:
    Line 1, Col 1 has the pilcrow and style is body
    Character spacing is 0%
    Line height is single (1)
    Before and After paragraph are set to 0
    With the cursor just before Dedication:
    Left ruler set at 2.6 inches
    Style is Heading 1
    Character spacing is 0
    Line height is 1.5
    Before paragraph set to 190 pt
    After paragraph set to 0 (yeah, raised my eyebrow too)
    Place cursor between trailing n and pilcrow, press return.
    With cursor on first line of names, just prior to first character:
    Style is body text with Baskerville Regular 12 pt override.
    Text justification is left.
    Left ruler is set to 2.9 inches
    Right ruler is set to 6.7 inches
    Character spacing is 0
    Line-height is 1.2
    Before and after paragraph are 0
    Insert cursor before last Pilcrow and press return
    On the next line, there is a Pilcrow at col 1, place the cursor in front of it.
    Style is body style
    Character spacing is 0
    Line-height is multiple (1.2)
    Before paragraph is 0
    After paragraph is 216 pt.
    Press return to set the jump.
    Insert section break
    You can likely insert step 14 at step 7 and skip 9 - 13. It was late.
    The Dedication page looks like this:
    Hopefully, you missed something, or it wasn't sufficiently explained previously. I hope you can duplicate the above and discover unique, centered content in your ePub.

  • How to center text in Pages to correctly show on iBook reader

    Hi,
    I am trying something really easy but could not solve it. Hope someone can help.
    Ok, I know that if I choose ''Chapte Name'' as a pharagraph style, iBook reader automatically puts it into a new page, so the new page starts with the chapter name on top. I dont have any problems with my chapters.
    However, I want my book to start with a page that has a brief info about the author. I want this info in the middle of the page (also centered in the middle). Than I want to go to the second page with a ''dedication'' part where I write my thanks to people. I also want this in the middle and centered. And finally I want to add my book title and author name together on the 3rd page. After that the chapters will start.
    So, as I told you, the chapters work just fine. But when I try to center the text in the first 3 pages, (I press return several times on my keybord to do it) the pages interwine with each other. For example, the last part of page 2 goes on top of page 3.
    I think this happens because I press the return key to center the texts. So, is there a way to lock texts to the pages where they belong to prevent them to interwine with other pages even if I press return to center the text
    OR
    Is there another way to center text to prevent them to interwine with other pages...
    Thank you

    You could try asking in the Pages forum
    https://discussions.apple.com/community/iwork/pages

  • How to vertically center text within its container

    Whether in a button, or a text element, I see no way to center the text that you type *vertically* in the container.  I'm not talking about within the box element.  I mean just the text element itself.  If I size out a text area and start typing in it, I should be able to say center it vertically.  That's what I'm looking for anyway.   Help much appreciated.

    Text elements cannot be vertically centered as they are not containers. However, you can fake that somewhat by making the line-height very large. But this means if you have text spanning two lines it would be very far apart though

  • Can't figure out how to center text in text box

    I've made a text box over a line.
    How can I center the text in the text box?
    Please advise.
    Thanks

    I just talked to tech support and this is what they said to do. For example.
    Make a new form and then drop a "text field" into it.
    Goto the toolbar at the top and click on window then
    paragraph. The paragraph/font box will come up and you'll be
    able to see the different ways you can move text around.
    Thanks

  • How to center text in DIV

    Newbie with a really simply question. How would one center this text smack dab in the middle of this DIV (assuming that this DIV were already centered on the page?

    If you were doing it by hand in Source View, you would add  text-align:center; to the css for the div.
    From Design View, highlight the text and click the Align Center button in the Properties tab.
    EDIT: That would be for horizontal alignment. To align the text vertically (this only works if the text is on one line) you can set the line-height of the div to the same as the height of the div in the css...
    #your_div_id {
         text-align:center;
         line-height:70px;
         height:70px;
         width:400px;
         border:1px solid black;

  • How to center text in javafx interface

    Hi, first of all, sorry for my bad English... I'm Italian.. :)
    I'd like to center a Text in a Scene, but I can't.
    I tried with this code:
    Text {
    x: 0
    y: 450;
    font: Font { size: 30 }
    fill: Color.web("#337799")
    content: bind "bla bla ";
    textAlignment: TextAlignment.CENTER
    But it doesn't work... Do you know how can I do to it?

    A classical way, hinted by a_b_g, is to use the size of the text control (given by its bounds) to position it in an absolute way (eg. using translateX).
    That's what I did in the past.
    Today, I would prefer to use the Stack layout, which handles nicely such computations.

  • How to Link Text and Image as One Button?

    I can easily convert an image or text to a button, but how do I link them both as one button so when you mouseover either one, they both turn a color and when you click on one, they both turn a color before jumping to the scene?

    Include the image and the Text in the Button's Layer Set. Design the Sub-picture Highlight to affect both.
    Just remember that a Button is defined by a rectangle, that encompasses all elements in the Button, and that Buttons (no part) may overlap any other Button.
    Good luck,
    Hunt

  • How to shift text within an envelope template

    Hello,
    I have created an envelope template to mail out some thank you notes. The envelope size is smaller than the average business envelope (3.75 x 5" vs. the standard business). Naturally, I went in to page setup and created a custom size for this template. I ran into trouble when I saw that the recipient's name and address blocks are too far shifted to the right. They run off the page and forces many other pages to be created as a result.
    How can I shift the text back to the left? I, like many other smart users, have shifted to the iwork suite recently and I am having a little trouble assimilating. I tried to highlight the text and click the downward triangle, but the triangle will only shift right, and not left.
    I skimmed through other posts and couldn't find anything similar to my situation. Thank you for your help.

    Yes, I actually haven't thought of that yet. However, I'm attempting to merge my contacts within address book.
    I feel like it shouldn't take any drastic change in my document. I guess if all else fails, I'll resort to looking for that merge widget.

Maybe you are looking for

  • Wait Time / Timeout Time in waiting events

    Hi, From manual, I came to know that some of waiting events having wait time or time out duration. I have not understood, what happens if it has reached timeout. What happens next ? ( Will you explain in more detail ). It saysl it will renew wait eve

  • Reinitialization in replication

    Replication gurus, I have a transactional replication with updatable subscription setup having 1 publisher and 4 subscribers. All the servers are SQL 2008. Recently I faced a situation where in 2 subscribers got reinitialized automatically. When I ch

  • Need Help on WRFMGROUP - Manage Maintenance Groups for articles

    Hi, Has anybody used WRFMGROUP-Manage Maintenance Groups for articles for seasonal procuremen article creation. I need this to update some article master fields ( like Listing procedure) while creating the article in the background.( WRFAPC11) Kindly

  • GR and GI posting IDOC

    Hi, I need to post GR and GI posting at a same time. I am using MBGMCR message type. Posting is happening properly. But i need to map the material codes in line item to local material codes before postind. Can anybody suggest any user exit. I have al

  • Update using Apex_item.hidden help

    Hi, I want to update a table using apex hidden item as reference. But while updating, I encounter an error as invalid number. Here ID is the primary key column which is of datatype number. Below is my report query Select ID, DAYS_SPAN, comments, apex