首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
CSS 左边div固定,右边div自适应
】的更多相关文章
HTML左边盒子固定,右边盒子自适应
html: <div class="box1"> <div class="divA">DIVA</div> <div class="divB">DIVB</div> </div> css: <style type="text/css"> * { margin: 0; padding: 0; } .box1 { width: 100%; heig…
css-两个div并排,左边宽度固定右边自适应的布局 的实现方法
<div class= "container"> <div class="left"></div> <div class="right"></div></div> <style>/*方法一: BFC(块级格式化上下文)*/ .container{ width:1000px;height:400px;border: 1px solid red; } .left{ w…
flex 上下div固定, 中间div自适应
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> html,body{height:100%;margin: 0;padding: 0;} .flex-container{height: 100%;display: flex;flex-direction:…
CSS 实现左侧固定,右侧自适应两栏布局的方法
"左边固定,右边自适应的两栏布局",其中有老生常谈的float方法,BFC方法,也有CSS3的flex布局与grid布局.并非所有的布局都会在开发中使用,但是其中也会涉及一些知识点. 常用的宽度自适应的方法通常是利用了block水平的元素宽度能随父容器调节的流动特性.另外一种思路是利用CSS中的calc()方法来动态设定宽度.还有一种思路是,利用CSS3中的新型布局flex layout与grid layout. 效果图: HTML布局: <div class="out…
【HTML+CSS】右侧固定,左侧自适应布局
<style> *{ padding: 0; margin: 0; } #left{ float: right; width: 100%; height: 300px; } #box{ margin-right:220px; background-color: pink; height: 300px; } #right{ float: right; margin-right: -100%; width: 200px; height: 300px; background-color: yello…
CSS 左边div固定,右边div自适应
有时候我们会有这样的需求,如图,aside是导航或者某些链接,右边的main是显示重要的内容,左边需要定宽,右边的main能够自适应剩余的宽度: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3…
实现一个div,左边固定div宽度200px,右边div自适应
实现一个div,左边固定div宽度200px,右边div自适应<div class= "container"> <div class="left"></div> <div class="rigth"></div> </div> <style> /*方法一: BFC(块级格式化上下文)*/ .container{ width:1000px;height:400px;…
css样式实现左边的固定宽度和高度的图片或者div跟随右边高度不固定的文字或者div垂直居中(文字高度超过图片,图片跟随文字居中,反之文字跟随图片居中非table实现)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Typ…
css实现左边div固定宽度,右边div自适应撑满剩下的宽度
(1)使用float <div class="use-float"> <div></div> <div></div> </div> .use-float>div:first-child{ width:100px; float:left; } .use-float>div:last-child{ overflow:hidden; } ------------------------------------…
实现左边div固定宽度,右边div自适应撑满剩下的宽度的布局方式:
html: <div class="container"> <div class="left"> left固定宽度200px </div> <div class="right"> 可变宽度rightrightrightrightrightrightrightrightri </div> </div> 方式一:利用bfc .left{ width:200px; float:le…