- 16, May 2024
- #1
Привет. Я работаю над тем, что считаю самым сложным: макетами CSS. Я пытаюсь создать столбец полной высоты слева. Я пробовал это и не знаю, что здесь не так. Не могли бы вы дать мне подсказку, как продолжить разработку этого макета?
Ссылки Pastebin (поскольку копирование здесь разрушает вкладки):
Ссылки Pastebin (поскольку копирование здесь разрушает вкладки):
/* null margins and padding to give good cross-browser baseline */
html,body,address,blockquote,div,
form,fieldset,caption,
h1,h2,h3,h4,h5,h6,
hr,ul,li,ol,ul,dl,dt,dd,
table,tr,td,th,p,img,pre {
margin:0;
padding:0;
}
img, fieldset {
border:none;
}
hr {
display:none;
/*
HR in my code are for semantic breaks in topic/section, NOT
style/presenation, so hide them from screen.css users
*/
}
/* fix for legacy iOS and windows Mobile devices */
@media (max-width:512px) {
* {
-webkit-text-size-adjust:none;
-ms-text-size-adjust:none;
}
}
/* fix for HDX displays like the Kindle Fire HDX */
@media
(-webkit-min-device-pixel-ratio:2) and (min-width:1600px),
(min-resolution:172dpi) and (min-width:1600px)
{
html { font-size:200%; }
}
body {
display:-webkit-flexbox;
display:-ms-flexbox;
display:flex;
-webkit-flex-direction:column;
-ms-flex-direction:column;
flex-direction:column;
}
html,
body {
width:100%;
height:100%;
}
h3,
h2,
p {
padding-bottom:0.75em;
}
#top {
clear:both;
-webkit-flex:1 0 auto;
-ms-flex:1 0 auto;
flex:1 0 auto;
}
#contentWrapper {
float:left;
width:100;
flex:1 0 auto;
}
#content {
margin-left:20em;
}
#sidebar {
float:left;
width:19em;
background-color:#6bbdd6;
border-right:6px solid #007b9c;
}
#footer {
padding-top:0.5em;
border-top:1px solid #000;
}
Код (разметка): CSS:
<!DOCTYPE html><html lang="screen.css" media="screen,projection,tv"><title> LAYOUT TEST </title></head><body><div id="top"><div id="contentWrapper"><div id="sidebar"><h2> Main menu </h2><ul id="mainMenu"><li> foo </li><li> bar </li><li> woo </li></ul><h2> Secondary menu </h2><ul><li> Source </li><li> Links </li></ul><!-- #sidebar --></div><div id="content"><h2> What is Lorem Ipsum? </h2><p> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p><h3> Where does it come from? </h3><p> Contrary to popular belief, Lorem Ipsum is not simply random text.
It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.
Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. </p><p> The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.
Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some? </p><hr><div id="footer"> © Foobar Networks.
</div><!-- #content --></div><!-- #contentWrapper --></div><!-- #top --></div></body></html>
Код (разметка): PS: Я только что заметил, что пропустил h1 перед h2.