带有图像和标题的盒子的基本 html css 设计

发布于 2024-09-07 19:30:56 字数 614 浏览 3 评论 0原文

我不是一个很好的设计师。至少html和css不行。我一直在使用一个非常简单的代码,如下所示:

<fieldset style=\"color: #000000; border: 1px solid #000000; width: 225px; text-align: left; padding: 5px;\">
<legend style=\"color: #999999; font-weight: bold;\">Headline.</legend>
<p>text</p>
</fieldset>

在我正在开发的 php 在线游戏中输出信息。我需要类似的东西,稍微好看一点。我可以寻求帮助吗?我在想这样的事情:

<h2 class="entry-title">Example</h2>
<img= examples.jpg" >
<div class="entry-content">
</div>

但我不确定我可以编写什么CSS代码来对我当前使用的字段集/图例产生类似的效果。我需要一个带有标题的框,左侧有图像,图像右侧有 tekst。

I am not a very good designer. At least not with html and css. I have been using a very simple code like this:

<fieldset style=\"color: #000000; border: 1px solid #000000; width: 225px; text-align: left; padding: 5px;\">
<legend style=\"color: #999999; font-weight: bold;\">Headline.</legend>
<p>text</p>
</fieldset>

To output information in a php online game i am working on. I need something similar, put a little better looking. Can I get some help. I was thinking something like:

<h2 class="entry-title">Example</h2>
<img= examples.jpg" >
<div class="entry-content">
</div>

But im not sure what css code i can write to make a similar effect to the fieldset/legend that im currently using. I need a box with a title, an image on the left side and tekst on the right side of the image.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小…红帽 2024-09-14 19:30:56

您可以尝试使用下面的 div 块。

<div class="fieldset">
<h2 class="entry-title">Example</h2>
<img= examples.jpg" >
<div class="entry-content">
</div>
</div>

作为样式,首先为您的字段集 div 提供边框。然后,您可以相对于播放顶部和左侧值的字段集 div 定位 h2 标签。并确保您的 body 背景、filedset div 的背景和 h2 标签的背景相同。最后将 div 条目内容和图像浮动到左侧。

经过一些调整,您应该会得到类似的标签外观。

You could try use the div block below.

<div class="fieldset">
<h2 class="entry-title">Example</h2>
<img= examples.jpg" >
<div class="entry-content">
</div>
</div>

As styling, first give a border to your fieldset div. Then, you could just position the h2 tag relatively to your fieldset div playing top and left values. and be sure that your body background, filedset div's background and h2 tag's background is the same. Finally float both div entry-content and the image to left.

With a little tweaking you should get a similar looking of tag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文