图像和表格之间的 HTML/CSS 文本段落

标签 html css forms image

一段时间以来,我一直在尝试解决这个问题,如果我继续尝试自己解决这个问题,我想我的脑袋会爆炸。

我正在尝试做一些非常简单的事情,但我没有运气。我基本上是想在图像和表单之间添加标题和段落。

这是现在的样子:

这就是我试图让它看起来像的东西:

相关代码如下: HTML:

<div id="content_section4">
    <p><img class="round" src="images/image5.jpg" alt="image1" height=175 width=175/></p>
    <h1 id="connect">Connect</h1>
    <div id="connect">blah blah blha blah joiefje blah blah blahblah blah balah I suck at html I hate my life 
    blah blah blah I have a cat blah blah blah blah blah blah blah eu2398re23ioj</div>

    <!--contact form here-->
    <div id="contact">
        <br>
        <form action="MAILTO:blah@blah.com" method="POST" enctype="text/plain">
            <input name="name" type="text" value="Name" size="40" onclick="this.value = '';"/> <br><br>
            <input name="email" type="text" value="Email" size="40" onclick="this.value = '';"/> <br><br>
            <textarea name="message" rows="10" cols="33" type="text" style="overflow:auto;resize:none" />Message</textarea> <br><br>
            <input type="submit" value="Send email"/>
        </form>
    </div>
</div><!--end contact_section4-->

还有 CSS:

#content_section4 {
    float: left;
    text-align: justify;
    padding-left: 20px;
}

#content_section4 img {
    float: left;
}

#connect {
    width: 425px;
    padding-left: 205px;
}

#contact {
    float:right;
}

I don't have tons of experience in web design and I have been fussing with this for hours.  Any help is greatly appreciated =)

最佳答案

你的 html 将是这样的..

<div id="content_section4">
<div id="content_left">
<p><img class="round" src="images/image5.jpg" alt="image1" height=175 width=175/></p>
<h1 id="connect">Connect</h1>
<div id="connect">blah blah blha blah joiefje blah blah blahblah blah balah I suck at html I hate my life 
blah blah blah I have a cat blah blah blah blah blah blah blah eu2398re23ioj</div>
</div>
<!--contact form here-->
  <div id="contact">
    <br>
    <form action="MAILTO:blah@blah.com" method="POST" enctype="text/plain">
        <input name="name" type="text" value="Name" size="40" onclick="this.value = '';"/> <br><br>
        <input name="email" type="text" value="Email" size="40" onclick="this.value = '';"/> <br><br>
        <textarea name="message" rows="10" cols="33" type="text" style="overflow:auto;resize:none" />Message</textarea> <br><br>
        <input type="submit" value="Send email"/>
    </form></div>
</div>

你的 css 将是这样的..

#content_section4 {
float: left;

text-align: justify;

padding-left: 20px; 

}

#content_section4 img, #content_left {

float: left;

}

#connect {

width: 425px;

padding-left: 205px;

}

#contact {

float:right;    

}

享受乐趣..

关于图像和表格之间的 HTML/CSS 文本段落,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19556879/

相关文章:

c++ - 自动填写 Web 表单

html - HTML 中的内联 SVG - 相同的字体大小呈现更大

css - 同一个 DIV 中具有不透明背景的图像和文本

php - 如何居中对齐 wordpress 网站主页的标题?

javascript - 如何用子div屏蔽父div?

html - 在 Accordion 中添加一个表单

javascript - IE 中 iframe 内的框架

javascript - 溢出-x :hidden; can still scroll when open at my phone

javascript - 如何停止滚动延迟到父滚动条

javascript - 克隆/重用 html 表单(使用 javascript)