gpt4 book ai didi

html - 修复标签的背景

转载 作者:行者123 更新时间:2023-11-27 23:06:24 27 4
gpt4 key购买 nike

我正在尝试为某些标签修复背景图像,但我遇到了麻烦。
我使所有内容都具有响应性,但我真的不知道如何将标签与底层货架相匹配...
我还想将表格 div 放在同一层(但在货架图片之外)...
一切都将充满动态值,所以如果您阅读通用标签,请不要担心。

这是代码:

<!DOCTYPE html>
<html>
<head>
<!-- Il viewport rende tutto ciò che c'è al suo interno responsive riadattando gli elementi fino a 240px di larghezza del display-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>


.menusx {
float:left;
width:20%;
text-align:center;
margin-bottom:7px;
}
.menu {
float:left;
width:20%;
text-align:center;
margin-left: 5px;
margin-bottom:7px;
}
.menuitem {
background-color:#e5e5e5;
padding:8px;
margin-top:7px;
}

.menudiv {
background-image: url("http://static.hdw.eweb4.com/media/wallpapers_1920x1200/digital-art/1/1/wooden-shelves-digital-art-hd-wallpaper-1920x1200-7977.jpg");
width: 100%;
background-repeat: no-repeat;
background-size: contain;
}

.right {
background-color:#e5e5e5;
float:left;
width:20%;
padding:14px;
margin-top:7px;
text-align:center;
margin-left: 5px;
}

@media only screen and (max-width:620px) {
/* For mobile phones: */
.menu, .main, .right {
width:100%;
}
}
</style>
</head>
<body style="font-family:Verdana;color:#aaaaaa;">


<div style="overflow:auto">
<div class="menudiv" style="overflow:auto">
<div class="menusx">
<div class="menuitem">Link 1 sx</div>
<div class="menuitem">Link 2 sx</div>
<div class="menuitem">Link 3 sx</div>
<div class="menuitem">Link 4 sx</div>
</div>


<div class="menu">
<div class="menuitem">Link 1</div>
<div class="menuitem">Link 2</div>
<div class="menuitem">Link 3</div>
<div class="menuitem">Link 4</div>
</div>
</div>


<div class="right">
<h3>Table</h3>
<p>Dynamic content of the table</p>
</div>
</div>


</body>
</html>



这是基本思路:Goal

最佳答案

只要移动你的,

<div class="right">
<h3>Table</h3>
<p>Dynamic content of the table</p>
</div>
</div>

<div style="overflow:auto">里面 block ,代码应该是这样的,

<div style="overflow:auto">
<div class="menudiv" style="overflow:auto">
<div class="menusx">
<div class="menuitem">Link 1 sx</div>
<div class="menuitem">Link 2 sx</div>
<div class="menuitem">Link 3 sx</div>
<div class="menuitem">Link 4 sx</div>
</div>

<div class="menu">
<div class="menuitem">Link 1</div>
<div class="menuitem">Link 2</div>
<div class="menuitem">Link 3</div>
<div class="menuitem">Link 4</div>
</div>
<div class="right">
<h3>Table</h3>
<p>Dynamic content of the table</p>
</div>
</div>
</div>

工作演示:https://jsfiddle.net/wrtjx0x0/4/

希望这对您有所帮助!

关于html - 修复标签的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48822585/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com