scrollheight
offsetHeight
clientHeight
scrollTop
scrollheight
offsetHeight
clientHeight
scrollTop
1) margin:0 != margin:0px
2) html 的注释(comments)会造成一些莫名其妙的错误,尤其是ie6。
1) question: the height of div is not Adaptive,while its content changes.
问题:外层div的高度不能随着内层div内容的高度变化而变化(自适应高度)
example:
html:
<div id=”a”><div id=”b”><div class=”c”></div></div></div>
css:
#a{width:855px;background-color:#412116;}
#b{background-color:#FFFFFF;width:840px;}
.c {width:430px;float:left;padding:0;margin:0;}
result: in firefox ,the height of “a” and “b” is not adaptive as “c”.
MY resolvent : write another div “d” ,put it under c.
.d{width:100%;clear:both;}
PS: Welcome new resolvents.
2)if you want to create a fixed height of square with one kind of color in your pages,I think border is better than background-color.
example:
.a {border-bottom:5px #fe5b1a solid;width:100%;}
.b {height:5px; background-color:#fe5b1a; width:100%;}
result: in ie6,a shows right.but b’s height is not 5px
Above is only my experience,if there are any problems,welcome to put forward a proposal.
1)decide the layout according the design using div with different background colors.
2)test your layout in every browser.
3)slice the needed pics.
4)create element accroding the order of divs.when you done one div,you should test in all browsers.
5)Once you done one div,you can remove the background color or you can remove them once when you done all divs.
6)add the js function that make your page works.
1)code:
<form action=”” name=””…><div ….>…</div>…<div ….></div><table …>…</table>…<table …>…</table>
2)what I want:
move <form…> of all pages down before the first <table…>
3)solve:
search: <form(.*)>((\n|\r|.)*)?<table
replace:$2<form$1><table
Hello world!