随笔分类 -  css

摘要:在某些特定的场合,在没有知道宽度的情况下却要求水平居中,今找到些解决方法,现转过来一起学习学习 方案一、利用浮动的包裹性和相对定位百分比数据值特性,传说称之为“相对浮动” .unknow_width_center1 {position:relative; left:50%; float:left;} 阅读全文
posted @ 2016-03-01 10:47 ifIhaveWings 阅读(556) 评论(0) 推荐(0)
摘要:1.text-align 属性规定元素中的文本的水平对齐方式。该属性通过指定行框与哪个点对齐,从而设置块级元素内文本的水平对齐方式。通过允许用户代理调整行内容中字母和字之间的间隔,可以支持值 justify;不同用户代理可能会得到不同的结果。 left 把文本排列到左边。默认值:由浏览器决定。 ri 阅读全文
posted @ 2016-03-01 10:28 ifIhaveWings 阅读(192) 评论(0) 推荐(0)
摘要:原理: 每个li的宽度是100px;其右、下的margin都是20px,每个li都是左浮动的;ul的宽度是360px;ul的宽度是360px;让ul的父divoverflow:hidden;即可。 <!doctype html><html><head><meta /><title>Title</ti 阅读全文
posted @ 2016-02-24 13:32 ifIhaveWings 阅读(487) 评论(0) 推荐(0)
摘要:<!doctype html> <html> <head> <meta /> <title>Title</title> <style type="text/css"> *{ margin:0; padding:0;} .wrap { margin: 0 auto; width: 600px; cle 阅读全文
posted @ 2016-02-24 13:21 ifIhaveWings 阅读(1146) 评论(0) 推荐(0)
摘要:.selector{ position: fixed; width: 100%; height: 100%; background-image: url(path); background-repeat: no-repeat; background-position: center center; ... 阅读全文
posted @ 2015-12-16 19:03 ifIhaveWings 阅读(612) 评论(0) 推荐(0)
摘要:原文地址:http://www.cr173.com/html/17948_1.html示例: margin-right: 5px; margin-right: 2px\9; 注意要写在分号的前面。CSS hack由于不同的浏览器,比如Internet Explorer 6,Internet Expl... 阅读全文
posted @ 2015-12-11 10:54 ifIhaveWings 阅读(187) 评论(0) 推荐(0)