设置图像和一些文本的样式
我正在与别人的造型合作,但无法得到他们设法得到的东西。我试图让事情看起来像这个页面:
http://www.comehike.com/ Outdoors/parks/add_trailhead.php
看看图像如何很好地位于右侧,而表单元素位于左侧。
我正在弄乱这个页面并试图制作类似的页面:
http://www.comehike。 com/account/member_home.php
有没有一种简单的方法可以使图像转到最左侧,而要求用户登录的内容位于右侧?
谢谢!
I am working with someone else's styling, and can't get things as they managed to. I am trying to make things look like this page:
http://www.comehike.com/outdoors/parks/add_trailhead.php
See how the image is nicely on the right, and the form elements are on the left.
I have this page that I am messing with and trying to make similar:
http://www.comehike.com/account/member_home.php
Is there an easy way for me to make the image go to the far left, and the stuff asking the person to log in, to be on the right?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先更改
.basic
中第一个div
的宽度。将宽度更改为100%
而不是450px
您应该可以从那里继续。
我还将图像移动到它自己的容器中并向右浮动,然后将表单操作放入另一个容器中。另外,利用类和 id 进行样式设计以清理内容。
Start with changing the width on the first
div
within.basic
. Change the width to100%
instead of450px
You should be able to continue from there.
I would also move the image into it's own container and float that right, and put the form actions in another container. Also, make use of classes and ids for styling to clean things up.
以下是如何充分利用浮动元素:
HTML:
CSS:
Here is how you can make food use of floating elements:
HTML:
CSS:
将 div 替换为
width: 450px
为width: 100%
,然后将子 H3float: left
Replace the div with
width: 450px
towidth: 100%
then the child H3float: left
将 div 的宽度增加到 845px。
将图像浮动到左侧。
对于 h3 标签进行样式设置
}
这将为您完成任务。
从 HTML 中删除空标签。
increase the width to 845px for the div.
Float image to the left.
for the h3 tag do the styling
}
This will do the task for you.
Remove the empty tags from the HTML.