1 Replies - 202 Views - Last Post: 29 June 2013 - 01:28 AM Rate Topic: -----

#1 Adriel16  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 21-May 13

I don't know how to align text under an image using CSS

Posted 29 June 2013 - 01:19 AM

Hi I'm new to HTML and CSS and Javascript. I'm looking to start a business and I want to make a website for the business to save money. I have been able to align the image to the center of the page; however, I'm having trouble figuring out how to align the text vertically under the image. This my html.

HTML MARKUP
<body>
  <img src = "cleangarage.jpg"
    height = "240"
    width  = "380" />
<ul>
  <li><a href = "myFirst.html"><Home></li>
  <li><a href = "About.html"><About Us></li>
</ul>



CSS
<style type = "text/CSS">
  img {
   position: absolute;
   top: -689; bottom: 0; left: 0; right: 0;
   float: center;
   width: 50%
   clear: both;
   margin: auto;
  }
  
  ul li {
    text-align: center;
    width: 240;
    height: 380;
  }



I have tried other methods that have not worked including div. In another forum it was suggested to use "span"; however, I don't know how to use it.

Is This A Good Question/Topic? 0
  • +

Replies To: I don't know how to align text under an image using CSS

#2 Adriel16  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 21-May 13

Re: I don't know how to align text under an image using CSS

Posted 29 June 2013 - 01:28 AM

can someone close this please. I just saw the web development tab and I've moved the code and question there. thank you and sorry. I had forgotten.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1