Simple html alignment problem...

by 6 replies
7
I'm creating a landing page in html. I have a large image as the background. I've added some text in dreamweaver over that image but the problem is, when I view the page in a browser, the text loses alignment with the background.

I can get it back in place by stretching the width of the browser. But I'm looking for a way to have the text stay in alignment with the background.

Hope what I'm asking is clear...

Thanks
#website design #alignment #html #problem #simple
  • Is the website you're referring to in your signature?
    • [1] reply
    • No it's not the site in my signature. I'm creating an html landing page that I havent uploaded yet...

  • Not really. Is the "text" part of the image or something superposed by html?
    • [1] reply
    • The text is not a part of the image. I guess its superimposed using html. I used a div tag that is formatted in my stylesheet.

      In dreamweaver, it's aligned fine. But when I preview it in any browser, the alignment is off to the left. But when I make the browser narrower by clicking the edge of the browser and dragging it in, the background will stay centered and eventually line up with the text.

      I figure theres a way to use the css sheet to make the text flow with the background and hold it's position.

      Hope that makes sense...

  • You can create a container with a fixed width that has auto margins (which will allow it to center automatically) If you can link an example, I can fiddle you a fix..
    • [ 1 ] Thanks
  • Hello you need to fix the width of your page main container and give margin:auto 0; .
    I you want to text alignment then write this in your css file text-align:justify or left.
    Your image will be in background if you want that text come on background.

Next Topics on Trending Feed

  • 7

    I'm creating a landing page in html. I have a large image as the background. I've added some text in dreamweaver over that image but the problem is, when I view the page in a browser, the text loses alignment with the background. I can get it back in place by stretching the width of the browser. But I'm looking for a way to have the text stay in alignment with the background.