0

I have an image of a map, and I want to add the address to the right hand side of it, I can't seem how to figure it out. Can any one help, this is the part of the coding I'm using:

<div id="main">
<span style="margin-top:5px;
        margin-left:5px;
              text-align:right;">
       <h1 align="center" style="font-size:40px;"><span style="color:red;">Contact</span><span style="color:#FFFFFF;"> Us</span></h1>

  <img id="map" src="images/map.png" title="Image of Map for Krazie Needles." align="centre" />
<p align="left" style="margin-left:5px;
          margin-top: 5px;">
    45 Station Road

with the css code

       #main
{

    margin-top:42px;
    margin-left:auto;
    margin-right:auto;
    position:relative;
    background:rgba(16,16,17,0.70);
    height:85%;
    width:90%;
    box-shadow: 3px 3px 2.5px #888888;
    border-radius:5px;
}   

img#map
{
    margin-left:5px;
    border-radius:5px;
    border-style:solid;
    border-width:2px;
    border-color:#FFFFFF;
}

I want to align the < p > tag next to the image.

4

4 回答 4

1

您可以float: left;在图像标签上使用(请参阅W3.org 上的浮动),或将图像放在<p>.

于 2012-06-02T11:39:26.230 回答
1
于 2012-06-02T11:51:16.883 回答
1

在 img 标签中,将(不正确的)更改align="centre"align="left".

(注意,img 标签上没有 center 属性。)

于 2012-06-02T11:57:14.323 回答
0

您应该将float:left添加到图像 css。如果要将地址放在 Map 上,则必须将position:absolute添加到带有地址 css 的段落。

于 2012-06-02T12:00:25.960 回答