<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Basic Tabs - jQuery EasyUI Demo</title> <style type="text/css">.divtop{ padding: 10px; background: black;}.divquery{ background: blue; height:200px; float:left;}.divbtn{ float:left; width:120px; background: red; height:200px;}.qitem { display:inline-block; line-height:30px; text-align:right; width:250px; height:25px; overflow:hidden; background: green;}</style></head><body> <div class="divtop"> <div class="divquery"> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> </div> <div class="divbtn"> </div> </div></body></html>
我想实现的效果是,
1.红色的div和蓝色的div并列,当页面宽度变化的时候,红色的div的宽度固定,蓝色的div宽度自适应
2.绿色的div宽度固定,当宽度不够的时候,绿色的div能换行排列,现在这个没问题
现在的情况是,红色的div经常跑到蓝色下面去,如图:
请教如何调整?另外,黑色的div为什么只显示那么一点点?不是应该把蓝色和红色都覆盖吗?他是最顶层的div啊?
回复讨论(解决方案)
红色div float:right
红色div float:right
不行呢,换成right,还是在下面,只是变成靠右边了
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Basic Tabs - jQuery EasyUI Demo</title> <style type="text/css">.divtop{ padding: 10px; background: black;}.divquery{ background: blue; height:200px; float:left; width:80%}.divbtn{ float:left; width:20%; background: red; height:200px;}.qitem { display:block; line-height:30px; text-align:right; width:15%; float:left; height:25px; overflow:hidden; background: green; margin:0.4rem;}</style></head><body> <div class="divtop"> <div class="divquery"> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> </div> <div class="divbtn"> </div> </div></body></html>
定义宽度
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Basic Tabs - jQuery EasyUI Demo</title> <style type="text/css">.divtop{ padding: 10px; background: black;}.divquery{ background: blue; height:200px; float:left; width:80%}.divbtn{ float:left; width:20%; background: red; height:200px;}.qitem { display:block; line-height:30px; text-align:right; width:15%; float:left; height:25px; overflow:hidden; background: green; margin:0.4rem;}</style></head><body> <div class="divtop"> <div class="divquery"> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> </div> <div class="divbtn"> </div> </div></body></html>
定义宽度
谢谢!但是我不想定义divquery的宽度,因为我已经制定了divbtn的宽度,那么divquery的宽度就是剩余的部分了,如果指定宽度,或者用百分比,可能会导致页面有留白的部分,我希望他们能无缝的合并在一起呢
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Basic Tabs - jQuery EasyUI Demo</title> <style type="text/css">.divtop{ padding: 10px; padding-right:130px; background: black; overflow:hidden; position:relative;}.divquery{ background: blue; height:200px; float:left;}.divbtn{ float:left; width:120px; background: red; height:200px; right:10px; position:absolute;}.qitem { display:inline-block; line-height:30px; text-align:right; width:250px; height:25px; overflow:hidden; background: green;} </style> </head><body> <div class="divtop"> <div class="divquery"> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> <span class="qitem"> </span> </div> <div class="divbtn"> </div> </div> </body></html>给分吧。。

HTML的作用是通过标签和属性定义网页的结构和内容。1.HTML通过到、等标签组织内容,使其易于阅读和理解。2.使用语义化标签如、等增强可访问性和SEO。3.优化HTML代码可以提高网页加载速度和用户体验。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代码” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代码”代码“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。

HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。

HTML适合初学者学习,因为它简单易学且能快速看到成果。1)HTML的学习曲线平缓,易于上手。2)只需掌握基本标签即可开始创建网页。3)灵活性高,可与CSS和JavaScript结合使用。4)丰富的学习资源和现代工具支持学习过程。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。

如何设计菜单中的虚线分割效果?在设计菜单时,菜名和价格的左右对齐通常不难实现,但中间的虚线或点如何...

网页代码编辑器中的HTML元素分析许多在线代码编辑器允许用户输入HTML、CSS和JavaScript代码。最近,有人提出了一...


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

SublimeText3汉化版
中文版,非常好用

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

禅工作室 13.0.1
功能强大的PHP集成开发环境