CSS 布局 div HTML
<html><head> <title>无标题</title> <style type="text/css"> .hbox{ } .vbox{ } </style><body> <div width="100%" height="100%" class="hbox"> <div width="50%" height="100%" class="vbox"> <img src="/static/imghwm/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > <img src="/static/imghwm/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > </div> <div width="50%" height="100%" class="hbox"> <img src="/static/imghwm/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > <img src="/static/imghwm/default1.png" data-src="mr.jpg" class="lazy" style="max-width:90%" style="max-width:90%"/ alt="求教div结合css布局问题_html/css_WEB-ITnose" > </div> </div></body></html>
效果是下面这种样子,首先水平布局分两栏,然后左边是垂直布局,右边是水平布局,如何写css?
回复讨论(解决方案)
补充下效果图:
<!DOCTYPE html><html> <head> <style> .content{ width:300px; height:200px; border:solid 1px red; } .contentLeft{ float:left; width:33%; height:100%; border-right:solid 1px #ccc; } .leftTop{ width:100%; height:50%; border-bottom:solid 1px black; } .leftbottom{ width:100%; height:50%;} </style> </head> <body> <div class="content"> <div class="contentLeft"> <div class="leftTop"></div> <div class="leftbottom"></div> </div> <div class="contentLeft"></div> <div class="contentLeft"></div> </div> </body></html>
可不可以只设置两个样式就完成这种效果,一个是水平的样式,一个是垂直的样式,基于我代码中的那样?
自己修改一下
<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script src="../Res/Script/jquery-1.9.1.js"></script> <style type="text/css"> * { margin:0px; padding:0px; } .hbox { height: 50%; width: 100%; float:left; } .vbox { width: 50%; height: 100%; float:left; } </style></head><body> <div width="100%" height="100%" class="hbox" style=" background:#c8f3f3"> <div width="50%" height="100%" class="vbox"> <div style="background: #808080" class="hbox" >A</div> <div style="background: #2aac3c" class="hbox">B</div> </div> <div width="50%" height="100%" class="vbox"> <div style="background: #ffd800" class="vbox">C</div> <div style="background: #ff0000" class="vbox">D</div> </div> </div></body></html>
搞定了,谢谢qq290032431和w_mojian180!

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool