让div居中心对齐
来源:互联网 发布:衣服淘宝文案描述 编辑:程序博客网 时间:2024/06/05 19:36
<html><head><title>css样式练习</title><meta charset="utf-8"><meta http-equiv="content-type" content="text/html;charset=urf-8"><meta http-equiv="keywords" content="111,222"><link rel="stylesheet" type="text/css" href="out.css"><!--嵌入式--><!--普通选择符--><!--类选择符--><!--id选择符--><style type="text/css">#div1 {border:1px solid red;width:98px;height:98px;margin:0 auto;}</style></head><body><div id="div1" >世界你好</div></body></html>注意:必须给它宽度,才能使用margin:0 auto;属性,才能使用float属性;
<html>
<head>
<title>css样式练习</title>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html;charset=urf-8">
<meta http-equiv="keywords" content="111,222">
<link rel="stylesheet" type="text/css" href="out.css">
<!--嵌入式-->
<!--普通选择符--><!--类选择符--><!--id选择符-->
<style type="text/css">
#div1 {
border:1px solid red;
width:98px;
height:98px;
margin:0 auto;
}
</style>
</head>
<body>
<div id="div1" >
世界你好
</div>
</body>
</html>
0 0
- 让div居中心对齐
- 让div居中对齐
- 让div居中对齐
- 让div居中对齐
- 如何让div居中对齐
- 让div在body中居中对齐
- 让div居中对齐的css
- DIV居中对齐
- DIV 居中对齐
- 让图片与按钮居中心对齐
- div中的内容居中对齐
- td中div居中对齐
- div内容垂直居中对齐
- 如何让div居中
- 让div居中
- 如何让DIV居中?
- 怎么让DIV居中
- 让DIV居中的CSS
- leetcode 083 Remove Duplicates from Sorted List(难易度:Easy)
- 用opencv的检测器检测人眼
- Android飞行模式下Wifi开关行为的控制
- OpenGL教程翻译 第十四课 相机控制(一)
- <a>标签的href和onclick属性
- 让div居中心对齐
- [hdu 5401] Persistent Link/cut Tree
- GDI+学习记录之纹理画刷TextureBrush
- Java-----Java获取路径
- ALS推荐算法在Spark上的优化--从50分钟到3分钟
- <meta http-equiv="refresh" content="0; url=">什么意思?
- 布局为空的fragment,显示“正在加载……”进度条
- iOS开发之网络--服务器配置
- 省市联查