MỘT SỐ BÀI TẬP THIẾT KẾ WEB CĂN BẢN- CSS khoa công nghệ thông tin... class="boxes"> id="submitbutton" value="Submit" /> Bài tập 8: Dùng css tạo gallery dạng thumbnail Over chuột vào
Trang 1MỘT SỐ BÀI TẬP THIẾT KẾ WEB
CĂN BẢN- CSS (khoa công nghệ thông tin)
Trang 2Phần 3 : Ngôn Ngữ CSS
Bài tập 7: Dùng css áp dụng dóng hàng khi thiết kế form không
dùng thẻ Table theo hình mẫu:
Hướng dẫn:
File css
label{
float: left;
width: 120px;
font-weight: bold;
} input, textarea{
width: 180px;
margin-bottom: 5px;
}
Trang 3textarea{
width: 250px;
height: 150px;
}
.boxes{
width: 1em;
}
#submitbutton{
margin-left: 120px;
margin-top: 5px;
width: 90px;
}
br{
clear: left;
}
input:focus, textarea:focus{
background-color: lightyellow;
}
File HTML
<html>
<head> <title>Form dùng Tableless</title>
href="Tableless.css" />
</head>
<body>
<form>
<label for="user">Name</label>
Trang 4<input type="text" name="user"><br />
<label>Email Address:</label>
<input type="text" name="emailaddress" ><br />
<label>Comments:</label>
<textarea name="comments"></textarea><br />
<label>Agree to Terms?</label>
class="boxes"><br />
id="submitbutton" value="Submit" />
</form>
</body>
</html>
Bài tập 8: Dùng css tạo gallery dạng thumbnail (Over chuột vào
thuận tiện cho việc tạo gallery trong phần admin hoặc trong các icon của mẫu tin
Trang 5 File CSS
.thumbnail{
position: relative;
z-index: 0;
} .thumbnail:hover{
background-color: transparent; z-index: 50;
} .thumbnail span{
position: absolute;
background-color: lightyellow; padding: 5px;
left: 200px;
border: 1px dashed gray;
width:280px;
text-align: justify;
visibility: hidden;
color: black;
text-decoration: none;
} .thumbnail span img{
border-width: 1;
Trang 6padding: 2px;
} .thumbnail:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */
}
File HTML
<html>
<head> <title>Table</title>
<link rel="stylesheet" type="text/css" href="Thumnail.css" />
</head>
<body>
<a class="thumbnail" href="#"><img src="h1.jpg" width="45" height="45">
height="200"><BR>Đây là đoạn CSS đơn giản để làm gallery dạng thumbnail, rất thuận tiện cho việc tạo gallery trong phần admin hoặc trong các icon của mẫu tin</span></a>
</body>
</html>