开发者

CSS: Getting Everything on One Side

开发者 https://www.devze.com 2023-04-11 14:29 出处:网络
Okay so i want the image and next to it i want the h1 and p! something like this 开发者_StackOverflow中文版 --------

Okay so i want the image and next to it i want the h1 and p! something like this

开发者_StackOverflow中文版 --------
|        |
|        | h1 tag with name
| Image  | p tag with description
|        |
|        |
 --------

<img src="" style="position:relative;left:10px;"> <h1 >SOmething</h1>
<p>asdasdsa</p>


Please use float:left css property on image and h1 elements. Then use p

OR

Create a table with two td

<table><tr><td>image</td><td>[H1] [P]</td></tr></table>


Do some thing like:

<img src="loading.gif" alt="Test image" style="float:left;"/><h1 style="float:left;">here</h1><p style="float:left;">abc</p>


html:

<image src="source.png" alt="alt" id="theimage"/>
<div id="nameanddescription">
<h1>Name</h1>
<p>description</p>
</div>

css:

#theimage
{
    float: left;
}

#nameanddescription
{
    float: left;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消