Mình thử mãi với margin và padding rồi mà nó không ra sát 2 bên, bạn nào biết cách để nó ra sát chỉ mh với nhiều cách càng tốt hì.
Hỏi về thẻ margin
Khả năng cao bạn chưa set margin của thẻ body về 0. Đây chỉ là dự đoán, bạn chưa code lên thì mọi người sẽ hỗ trợ được tốt hơn.
1 Like
Mặc định của trình duyệt nó cũng có style riêng. Nếu muốn làm theo ý mình em cần phải reset style về default
Tải file css này về rồi sử dụng như external style: normalize.css
hoặc sử dụng code riêng
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
or:
/* CSS reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
html,body {
margin:0;
padding:0;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset,img {
border:0;
}
input{
border:1px solid #b0b0b0;
padding:3px 5px 4px;
color:#979797;
width:190px;
}
address,caption,cite,code,dfn,th,var {
font-style:normal;
font-weight:normal;
}
ol,ul {
list-style:none;
}
caption,th {
text-align:left;
}
h1,h2,h3,h4,h5,h6 {
font-size:100%;
font-weight:normal;
}
q:before,q:after {
content:'';
}
abbr,acronym { border:0;
}
1 Like
Đúng là chỉ cần chỉnh
body {
margin: 0;
padding: 0;
}
Còn việc dùng Reset CSS để trả về default cũng không hẳn.
2 Likes
Phòng mọi trường hợp phát sinh bro =))
2 Likes
Mình hay phủ đầu bằng đoạn 
*{ margin: 0; padding: 0; }
1 Like

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?