How to Make and Inner Flexbox Scroll Vertically - html

I am trying to make a grid layout using flexbox where there are three rows: Header, Content & Footer. Inside the content area I have 2 flex columns.
My desired outcome is to have the header and footer to stay in place and only the main content section (row) scrolls vertically. I am able to achieve this however when I add a scroll-y class to the individual columns I would like the column divs to scroll independently and not the main content. However I can not seem to get this to work. I believe I need to do something with the max-height to the parent div, but any help would be appreciated. I have posted the css I am using and linked to a codepen of a simplified version of what I am looking to accomplish. Thank you in advance.
.full-height {
height: 100vh;
}
.rows {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.columns {
display: flex;
flex: 1 1 auto;
}
.row,
column {
display: flex;
padding: 20px;
}
.row.expand {
flex: 1;
max-height: 100%;
}
.column.expand {
flex: 1;
max-witdth: 100%;
}
scroll-no {
overflow: hidden;
}
scroll-y {
overflow-y: auto;
}
https://codepen.io/MrJesseWallace/pen/RwNqQgE?editors=1100

I hope this is what u r expecting check out my answer.
Add these css properties:
.header{
position:fixed;
top:0px;
width:100%;
}
.footer{
position:fixed;
bottom:0px;
width:100%;
}
.columns{
max-height:700px;
overflow:hidden;
}
.scroll-y{
overflow-y:scroll;
}
.header{
position:fixed;
top:0px;
width:100%;
}
.footer{
position:fixed;
bottom:0px;
width:100%;
}
.columns{
max-height:700px;
overflow:hidden;
}
.scroll-y{
overflow-y:scroll;
}
.yellow {
background-color: yellow;
}
.gray {
background-color: lightgray;
}
.full-height {
height: 100vh;
}
.rows {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.columns {
display: flex;
flex: 1 1 auto;
}
.row,
column {
display: flex;
padding: 10px;
}
.row.expand {
flex: 1;
max-height: 100%;
}
.column.expand {
flex: 1;
max-witdth: 100%;
}
<div class="rows full-height">
<div class="row yellow header">sss</div>
<div class="row expand gray scroll-y">
<div class="columns">
<div class="column expand scroll-no">
<p>I Should not scroll....</p>
<p>Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or
removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain
the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original. In a professional context it often happens that
private or corporate clients corder a publication to be made and presented with the actual content still not being ready. Think of a news blog that's filled with content hourly on the day of going live. However, reviewers tend to be distracted
by comprehensible content, say, a random text copied from a newspaper or the internet. The are likely to focus on the text, disregarding the layout and its elements. Besides, random text risks to be unintendedly humorous or offensive, an unacceptable
risk in corporate environments. Lorem ipsum and its many variants have been employed since the early 1960ies, and quite likely since the sixteenth century. Lorem Ipsum: common examples layout based on Lorem Ipsum Most of its text is made up
from sections 1.10.32–3 of Cicero's De finibus bonorum et malorum (On the Boundaries of Goods and Evils; finibus may also be translated as purposes). Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit
is the first known version ("Neither is there anyone who loves grief itself since it is grief and thus wants to obtain it"). It was found by Richard McClintock, a philologist, director of publications at Hampden-Sydney College in Virginia; he
searched for citings of consectetur in classical Latin literature, a term of remarkably low frequency in that literary corpus. Cicero famously orated against his political opponent Lucius Sergius Catilina. Occasionally the first Oration against
Catiline is taken for type specimens: Quo usque tandem abutere, Catilina, patientia nostra? Quam diu etiam furor iste tuus nos eludet? (How long, O Catiline, will you abuse our patience? And for how long will that madness of yours mock us?)
Cicero's version of Liber Primus (first Book), sections 1.10.32–3 (fragments included in most Lorem Ipsum variants in red): Cicero writing letters; from an early edition by Hieronymus Scotus Sed ut perspiciatis, unde omnis iste natus error sit
voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit,
sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci[ng] velit, sed quia non numquam [do] eius modi tempora inci[di]dunt, ut labore
et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit
esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? Lorem Ipsum: translation The Latin scholar H. Rackham translated the above in 1914: De Finibus Bonorum Et Malorum But I must explain to you
how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No
one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or
desires to obtain pain of itself, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except
to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce
with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those
who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing
prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have
to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains. Lorem Ipsum:
variants and technical information Adobe Fireworks Lorem Ipsum plugin In 1985 Aldus Corporation launched its first desktop publishing program Aldus PageMaker for Apple Macintosh computers, released in 1987 for PCs running Windows 1.0. Both contained
the variant lorem ipsum most common today. Laura Perry, then art director with Aldus, modified prior versions of Lorem Ipsum text from typographical specimens; in the 1960s and 1970s it appeared often in lettering catalogs by Letraset. Anecdotal
evidence has it that Letraset used Lorem ipsum already from 1970 onwards, eg. for grids (page layouts) for ad agencies. Many early desktop publishing programs, eg. Adobe PageMaker, used it to create template. Most text editors like MS Word or
Lotus Notes generate random lorem text when needed, either as pre-installed module or plug-in to be added. Word selection or sequence don't necessarily match the original, which is intended to add variety. Presentation software like Keynote
or Pages use it as a samples for screenplay layout. Content management software as Joomla, Drupal, Mambo, PHP-Nuke, WordPress, or Movable Type offer Lorem Ipsum plug-ins with the same functionality.</p>
</div>
<div class="column expand scroll-y">
<p>I Should scroll....</p>
<p>Lorem ipsum is a pseudo-Latin text used in web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps
to outline the visual elements of a document or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or
removal, so to deliberately render its content nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain
the letters K, W, or Z, alien to latin, these, and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original. In a professional context it often happens that
private or corporate clients corder a publication to be made and presented with the actual content still not being ready. Think of a news blog that's filled with content hourly on the day of going live. However, reviewers tend to be distracted
by comprehensible content, say, a random text copied from a newspaper or the internet. The are likely to focus on the text, disregarding the layout and its elements. Besides, random text risks to be unintendedly humorous or offensive, an unacceptable
risk in corporate environments. Lorem ipsum and its many variants have been employed since the early 1960ies, and quite likely since the sixteenth century. Lorem Ipsum: common examples layout based on Lorem Ipsum Most of its text is made up
from sections 1.10.32–3 of Cicero's De finibus bonorum et malorum (On the Boundaries of Goods and Evils; finibus may also be translated as purposes). Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit
is the first known version ("Neither is there anyone who loves grief itself since it is grief and thus wants to obtain it"). It was found by Richard McClintock, a philologist, director of publications at Hampden-Sydney College in Virginia; he
searched for citings of consectetur in classical Latin literature, a term of remarkably low frequency in that literary corpus. Cicero famously orated against his political opponent Lucius Sergius Catilina. Occasionally the first Oration against
Catiline is taken for type specimens: Quo usque tandem abutere, Catilina, patientia nostra? Quam diu etiam furor iste tuus nos eludet? (How long, O Catiline, will you abuse our patience? And for how long will that madness of yours mock us?)
Cicero's version of Liber Primus (first Book), sections 1.10.32–3 (fragments included in most Lorem Ipsum variants in red): Cicero writing letters; from an early edition by Hieronymus Scotus Sed ut perspiciatis, unde omnis iste natus error sit
voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit,
sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci[ng] velit, sed quia non numquam [do] eius modi tempora inci[di]dunt, ut labore
et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit
esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? Lorem Ipsum: translation The Latin scholar H. Rackham translated the above in 1914: De Finibus Bonorum Et Malorum But I must explain to you
how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No
one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or
desires to obtain pain of itself, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except
to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce
with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those
who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing
prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have
to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains. Lorem Ipsum:
variants and technical information Adobe Fireworks Lorem Ipsum plugin In 1985 Aldus Corporation launched its first desktop publishing program Aldus PageMaker for Apple Macintosh computers, released in 1987 for PCs running Windows 1.0. Both contained
the variant lorem ipsum most common today. Laura Perry, then art director with Aldus, modified prior versions of Lorem Ipsum text from typographical specimens; in the 1960s and 1970s it appeared often in lettering catalogs by Letraset. Anecdotal
evidence has it that Letraset used Lorem ipsum already from 1970 onwards, eg. for grids (page layouts) for ad agencies. Many early desktop publishing programs, eg. Adobe PageMaker, used it to create template. Most text editors like MS Word or
Lotus Notes generate random lorem text when needed, either as pre-installed module or plug-in to be added. Word selection or sequence don't necessarily match the original, which is intended to add variety. Presentation software like Keynote
or Pages use it as a samples for screenplay layout. Content management software as Joomla, Drupal, Mambo, PHP-Nuke, WordPress, or Movable Type offer Lorem Ipsum plug-ins with the same functionality. Lorem ipsum is a pseudo-Latin text used in
web design, typography, layout, and printing in place of English to emphasise design elements over content. It's also called placeholder (or filler) text. It's a convenient tool for mock-ups. It helps to outline the visual elements of a document
or presentation, eg typography, font, or layout. Lorem ipsum is mostly a part of a Latin text by the classical author and philosopher Cicero. Its words and letters have been changed by addition or removal, so to deliberately render its content
nonsensical; it's not genuine, correct, or comprehensible Latin anymore. While lorem ipsum's still resembles classical Latin, it actually has no meaning whatsoever. As Cicero's text doesn't contain the letters K, W, or Z, alien to latin, these,
and others are often inserted randomly to mimic the typographic appearence of European languages, as are digraphs not to be found in the original. In a professional context it often happens that private or corporate clients corder a publication
to be made and presented with the actual content still not being ready. Think of a news blog that's filled with content hourly on the day of going live. However, reviewers tend to be distracted by comprehensible content, say, a random text copied
from a newspaper or the internet. The are likely to focus on the text, disregarding the layout and its elements. Besides, random text risks to be unintendedly humorous or offensive, an unacceptable risk in corporate environments. Lorem ipsum
and its many variants have been employed since the early 1960ies, and quite likely since the sixteenth century. Lorem Ipsum: common examples layout based on Lorem Ipsum Most of its text is made up from sections 1.10.32–3 of Cicero's De finibus
bonorum et malorum (On the Boundaries of Goods and Evils; finibus may also be translated as purposes). Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit is the first known version ("Neither is there
anyone who loves grief itself since it is grief and thus wants to obtain it"). It was found by Richard McClintock, a philologist, director of publications at Hampden-Sydney College in Virginia; he searched for citings of consectetur in classical
Latin literature, a term of remarkably low frequency in that literary corpus. Cicero famously orated against his political opponent Lucius Sergius Catilina. Occasionally the first Oration against Catiline is taken for type specimens: Quo usque
tandem abutere, Catilina, patientia nostra? Quam diu etiam furor iste tuus nos eludet? (How long, O Catiline, will you abuse our patience? And for how long will that madness of yours mock us?) Cicero's version of Liber Primus (first Book), sections
1.10.32–3 (fragments included in most Lorem Ipsum variants in red): Cicero writing letters; from an early edition by Hieronymus Scotus Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem
aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem
sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet, consectetur, adipisci[ng] velit, sed quia non numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima
veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem
eum fugiat, quo voluptas nulla pariatur? Lorem Ipsum: translation The Latin scholar H. Rackham translated the above in 1914: De Finibus Bonorum Et Malorum But I must explain to you how all this mistaken idea of denouncing pleasure and praising
pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is
pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but occasionally
circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault
with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized
by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying
through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be
welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always
holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains. Lorem Ipsum: variants and technical information Adobe Fireworks Lorem Ipsum plugin
In 1985 Aldus Corporation launched its first desktop publishing program Aldus PageMaker for Apple Macintosh computers, released in 1987 for PCs running Windows 1.0. Both contained the variant lorem ipsum most common today. Laura Perry, then
art director with Aldus, modified prior versions of Lorem Ipsum text from typographical specimens; in the 1960s and 1970s it appeared often in lettering catalogs by Letraset. Anecdotal evidence has it that Letraset used Lorem ipsum already from
1970 onwards, eg. for grids (page layouts) for ad agencies. Many early desktop publishing programs, eg. Adobe PageMaker, used it to create template. Most text editors like MS Word or Lotus Notes generate random lorem text when needed, either
as pre-installed module or plug-in to be added. Word selection or sequence don't necessarily match the original, which is intended to add variety. Presentation software like Keynote or Pages use it as a samples for screenplay layout. Content
management software as Joomla, Drupal, Mambo, PHP-Nuke, WordPress, or Movable Type offer Lorem Ipsum plug-ins with the same functionality.</p>
</div>
</div>
</div>
<div class="row yellow footer">ss</div>
</div>

Related

How can I indent paragraphs, but exclude certain lines for formatting?

so I have been wracking my brain and trying different options to get this to work, but I can't seem to get anything to do what I want.
I am trying to indent the first line of paragraphs on a web page using
p {
text-indent: 3em;
}
However, I am also displaying information in a formatted manner, and the font needs to be displayed:
Description: Pargraph 1.
Paragraph 2...so on.
Label 2: ...
I would like to not indent the paragraphs that start with the bold-faced labels; because it throws formatting and alignment off and just generally does not look that good.
Is there anyway to stylize the P tag but exclude any tags that are also tagged with B or strong so that only paragraphs that do not start with a bold-faced character/word get indented?
I attempted to use
p:not(b)
and
p:not(strong)
but they didn't seem to work, I'm assuming because b and strong are not div ids/classes and won't work?
EDIT: To clarify, this is for a page on a Tumblr blog. The way Tumblr handles its customization; the blog itself has its own CSS Style sheet/html that can be edited. Then, additional pages can be added that can either be made entirely from scratch (losing some functionality because they no longer tie to the css of the main blog) or using a 'standard' layout that pulls and connects it to the css sheet of the main blog.
On the main blog, you can edit the displaced text in boxes and such with the classes as suggested:
p class=class name {
css
}
But in a standard layout page, the text editor is an extremely simplistic HTML editor; so you cannot specify a specific class for individual paragraphs and all text gets entered as:
<p> <strong> Description: </strong> Paragraph 1 </p> <br/>
<p> Paragraph 2 </p>
And it uses strong instead of b for bold; and em for italics.
Check the below snippet as an illustration of my comment above.
If your b or em are inside the p, then we may need different method. Please share your code for further discussion.
.bold {
font-weight: bold;
}
p:not(.bold) {
text-indent: 3em;
}
<p class="bold">
Paragraph
</p>
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Illo sapiente et expedita dicta vero natus nobis laudantium a voluptatum alias qui blanditiis perferendis, neque, nisi vel quibusdam doloribus id veniam.
</p>
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Illo sapiente et expedita dicta vero natus nobis laudantium a voluptatum alias qui blanditiis perferendis, neque, nisi vel quibusdam doloribus id veniam.
</p>

Pictures in HTML

I'm kinda new in HTML. I'm trying to make a page with HTML where I have text in the left of my page (the lyrics of a song) and then a picture that repeats itself at the right (just beside) of that text. But I want the picture to stop repeating itself at the bottom at some point. I want it to go just the length of the text, so I can write some thing below it, but the pictures just go endlessly. This is how I put the picture in the HTML file:
<style>
body
{
background:url("../imagenes/augustphotos.jpg");
background-repeat:repeat-y;
background-position:95% 0%;
}
</style>
Just to clarify: i want the image to repeat itself (one below itself again and again) but then STOP repeating at a certain point.
that's why i used "repeat-y". But with with it just goes on repeating itself, non-stop.
and the possition there (95%) is so it will place at the point i want it in the right of the page (so i can write a text at the left of it)
Also i receive a -1 point, im not very sure why but i'll leave the full code here, in case that was my error:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
<link rel="stylesheet" href="mihojadeestilosTSlyrics.css"/>
</head>
<style>
body
{
background:url("../imagenes/augustphotos.jpg"); /*La foto de August*/
background-repeat:repeat-y;
background-position:95% 0%;
}
</style>
<body>
<h1><span>August</span></h1>
<p>Salt air, and the rust on your door<br>
I never needed anything more<br>
Whispers of "Are you sure?"<br>
"Never have I ever before"</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine</p>
<p>Your back beneath the sun<br>
Wishin' I could write my name on it<br>
Will you call when you're back at school?<br>
I remember thinkin' I had you</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine</p>
<p>Back when we were still changin' for the better<br>
Wanting was enough<br>
For me, it was enough<br>
To live for the hope of it all<br>
Cancel plans just in case you'd call<br>
And say, "Meet me behind the mall"<br>
So much for summer love and saying "us"<br>
'Cause you weren't mine to lose<br>
You weren't mine to lose, no</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine<br>
'Cause you were never mine, never mine</p>
<p>But do you remember?<br>
'Remember when I pulled up and said, "Get in the car"<br>
And then canceled my plans just in case you'd call?<br>
Back when I was livin' for the hope of it all, for the hope of it all<br>
"Meet me behind the mall"</p>
<p>Remember when I pulled up and said, "Get in the car"<br>
And then canceled my plans just in case you'd call?<br>
Back when I was livin' for the hope of it all (For the hope of it all)</p>
<p>For the hope of it all<br>
For the hope of it all<br>
(For the hope of it all)<br>
(For the hope of it all)</p>
<script type="text/javascipt" src="custom.js"></script>
</body>
</html>
and then in the css file, there is this for the text:
body{position:absolute;
text-align:center;
padding:20px;
}
You try to assign the repeating image pattern to the whole page body - which is why it continues forever.
What you should do instead, is to create two DIVs (optionally wrapped inside a third, outer DIV), one for your text, one for the image, and make the CSS applicable only to the one with image.
See this CodePen for an example code:
#outerdiv {
display: flex;
}
#div1 {
width: 50%;
}
#div2 {
width: 50%;
background: url("https://images.unsplash.com/photo-1489389944381-3471b5b30f04?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80");
background-repeat: repeat-y;
}
<div id="outerdiv">
<div id="div1">"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia
voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi
tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui
in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</div>
<div id="div2"> </div>
</div>
Codepen
Here is your web page with a working side-image:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
</head>
<style>
#outerdiv {
display: flex;
}
#div1 {
width: 50%;
}
#div2 {
width: 50%;
background: url("https://images.unsplash.com/photo-1489389944381-3471b5b30f04?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80");
background-repeat: repeat-y;
}
</style>
<body>
<h1><span>August</span></h1>
<div id="outerdiv">
<div id="div1">
<p>Salt air, and the rust on your door<br>
I never needed anything more<br>
Whispers of "Are you sure?"<br>
"Never have I ever before"</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine</p>
<p>Your back beneath the sun<br>
Wishin' I could write my name on it<br>
Will you call when you're back at school?<br>
I remember thinkin' I had you</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine</p>
<p>Back when we were still changin' for the better<br>
Wanting was enough<br>
For me, it was enough<br>
To live for the hope of it all<br>
Cancel plans just in case you'd call<br>
And say, "Meet me behind the mall"<br>
So much for summer love and saying "us"<br>
'Cause you weren't mine to lose<br>
You weren't mine to lose, no</p>
<p>But I can see us lost in the memory<br>
August slipped away into a moment in time<br>
'Cause it was never mine<br>
And I can see us twisted in bedsheets<br>
August sipped away like a bottle of wine<br>
'Cause you were never mine<br>
'Cause you were never mine, never mine</p>
<p>But do you remember?<br>
'Remember when I pulled up and said, "Get in the car"<br>
And then canceled my plans just in case you'd call?<br>
Back when I was livin' for the hope of it all, for the hope of it all<br>
"Meet me behind the mall"</p>
<p>Remember when I pulled up and said, "Get in the car"<br>
And then canceled my plans just in case you'd call?<br>
Back when I was livin' for the hope of it all (For the hope of it all)</p>
<p>For the hope of it all<br>
For the hope of it all<br>
(For the hope of it all)<br>
(For the hope of it all)</p>
</div>
<div id="div2">
</div>
<script type="text/javascipt" src="custom.js"></script>
</body>
</html>
And here is how it looks:

How to make multiple line breaks in markdown to create white space, without typing multiple <br /> instances [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Introductory HTML student, I'm trying to learn how to make multiple line breaks without having to type multiple <br /> when using a WYSIWYG editor.
The solutions I've read so far suggest adding two spaces to the end of a line prior to moving to to the next line and this will create a space between paragraphs.
However when I attempt to add two spaces at the beginning of an empty line and press enter to move to the next, my output preview does not show that I'm creating additional blank lines.
The goal is to be able to add up to 4 blank lines between some paragraphs in the output content to help meet a formatting goal. My current best working solution is to type 4 <br /> in a row like this:
<!-- content here then four spaces to create white space before next content -->
<br />
<br />
<br />
<br />
<!-- next content -->
Is there another solution when writing in markdown to get a similar result?
The goal is to be able to easily create multiple (at least 4) line breaks when desired between paragraphs. Easily here means without having to type out <br /> or <br> every time I want to do this.
Any help is appreciated, and -if applicable-:
deeper understandings of how this process works,
recommendations on your fav literature, blogs, or documentation regarding this topic, and
any advice & anecdotes from a more experienced viewpoint about how you think about this kind of issue now, as opposed to how I am thinking about it in a more novice state.
depending on the WYSIWYG editor if you can access the CSS you could play with:
br { display:block; margin-top:10px; line-height:22px; }
increase the 10px and the 22px line-height to your convenience...
other than that I don't know... don't really see the downside of
(yes they can be on the same line)
it's just copy&paste after all?
Since you can change HTML code in this WYSIWYG editor (you did not specified which one it is), then you can also use style="" (CSS). Just make margin on paragraphs. You can use pixels (px) value, but if you wanna have value based on current font size then "em" will be better solution.
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat corporis aliquid adipisci alias vel. Odit consectetur saepe velit vel distinctio enim ipsam aperiam eaque, reiciendis itaque officiis ad fuga dolorem!</p>
<p style="margin-top: 3em">Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat corporis aliquid adipisci alias vel. Odit consectetur saepe velit vel distinctio enim ipsam aperiam eaque, reiciendis itaque officiis ad fuga dolorem!</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat corporis aliquid adipisci alias vel. Odit consectetur saepe velit vel distinctio enim ipsam aperiam eaque, reiciendis itaque officiis ad fuga dolorem!</p>

Hiding headings in the document outline for accessibility reasons

I have a question about ensuring good document structure when the visual design doesn't call for explicit headings.
Take the following example HTML for a homepage.
<header>
<h1>Our Brand</h1>
<p>Tagline</p>
</header>
<section class="company">
<h2>Our Company</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus error hic, aliquid assumenda sed optio, praesentium repellendus numquam laudantium esse molestias minima cum mollitia fugiat? Eum impedit deserunt aliquid ratione.</p>
</section>
<section class="values">
<h2>Our Values</h2>
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</li>
<li>Officia reiciendis illum temporibus. Praesentium repellat, iste officiis?</li>
<li>Quos facere enim officiis, recusandae inventore veritatis id.</li>
<li>Iste deleniti doloremque dignissimos, voluptate obcaecati velit optio.</li>
<li>Ut non enim, dolore saepe minus soluta illum?</li>
<li>Enim iure odit soluta laboriosam quis cupiditate eveniet.</li>
</ul>
</section>
<section class="team">
<h2>Our Team</h2>
<h3>Marketing</h3>
<ul>
<li>Lorem ipsum.</li>
<li>Voluptates, cupiditate.</li>
<li>Quia, ad?</li>
<li>Facere, blanditiis!</li>
</ul>
<h3>Social</h3>
<ul>
<li>Lorem ipsum.</li>
<li>Voluptates, cupiditate.</li>
<li>Quia, ad?</li>
<li>Facere, blanditiis!</li>
</ul>
<h3>PR</h3>
<ul>
<li>Lorem ipsum.</li>
<li>Voluptates, cupiditate.</li>
<li>Quia, ad?</li>
<li>Facere, blanditiis!</li>
</ul>
</section>
In this markup, there is a clear heading structure (i.e. h1 > h2 > h3).
But let's say it's been agreed that the 'Our Team' <h2> heading doesn't need to be shown as it is implied by the visual design. However, it is important for good document structure (for accessibility reasons).
Do we...
Show the 'Our Team' <h2> heading for screen readers and search engines using a '.visuallyhidden' class? (i.e. one which hides content off-screen)
Change all the <h3>s in the 'team' section to be <h2>s? This doesn't feel right from a contents perspective, as they feel like they should be contained under their own heading.
Skip the 'Our Team' <h2> heading and go straight to <h3>. Skipping heading levels doesn't seem right either.
Sidenote,
I've noticed that gov.uk (often hailed as a good accessibility site) do this. They are hiding a <h1> for their 'All Categories' heading. Also, they are hiding a <h2> in the footer for 'Support Links'
https://www.gov.uk/browse/benefits
Hiding the headings seems sensible but i've seen a lot of people posting about how Google will treat this as a black-hat SEO tactic.
I assume it would take a lot more than a couple of hidden headings to trigger any penalisation from Google, but maybe doing it on <h1>s would be a problem.
Any thoughts on this issue would be appreciated!
I would not worry about SEO penalties here. Years of addressing what you are trying to address suggest the effect is either none or negligible.
In your example, the <h2> has no content, it leads directly to the <h3>. In that scenario I always like to add some content so it isn't a hard visual / audio jump. As it is, if I navigate by heading in my screen reader, then I get no content under that <h2>, so it might already feel a bit odd.
Anyway, if you think you truly do not need the "Teams" text (visually or otherwise), then you could just remove it altogether and elevate the others to <h2>.
So from your three options:
Show the 'Our Team' <h2> heading for screen readers and search engines using a .visuallyhidden class? (i.e. one which hides content off-screen)
Meh. In my opinion, either there is content there to support it or there isn't. In your example, there is no content to support it. If you do decide to visually hide the text, don't do it off-screen as that can jack with RTL translations, look at a clipped text instead (there are many examples, that just happens to have a recent bit of tweaking).
Change all the <h3>s in the 'team' section to be <h2>s? This doesn't feel right from a contents perspective, as they feel like they should be contained under their own heading.
Do this one. I tend to agree in principle that Teams warrants its own heading. But to do that you need content under the Teams <h2>, in my opinion. If no content will go there and you remove the Teams <h2>, then this is your next best option.
Skip the 'Our Team' <h2> heading and go straight to <h3>. Skipping heading levels doesn't seem right either.
Nope. That is a WCAG failure for most auditors (I will fail it).
As far as the outline is concerned,
the heading <h2>Our Team</h2> does two useful things in your context:
it makes clear what "Marketing", "Social", and "PR" refer to (otherwise it would not be clear that these sections contain lists of team members)
it groups the three sections under one outline entry (otherwise they would be on the same level like "Our Values" etc., which wouldn’t make sense)
Visually hiding the heading fulfills both jobs. I would do this, but only if it’s really not possible to show the heading (which is typically always preferable), of course.
An alternative that fulfills the second job (grouping the entries), but not the first one (giving a useful label), is to use section elements explicitly (which is, by the way, recommended to do anyway):
<section class="team">
<h2>Our Team</h2>
<section>
<h3>Marketing</h3>
</section>
<section>
<h3>Social</h3>
</section>
<section>
<h3>PR</h3>
</section>
</section>
Now you could omit the h2 without changing the outline (except for the label, of course), so the three sections are still grouped, conveying that they belong together.
(Of course this only works for user agents that implement the outline algorithm.)

meta viewport has no effect in Chrome Device Mode

These are the steps to reproduce the problem (tested with Chrome 53.0.2785.101 and Chromium 53.0.2785.143, both 64 bits, in Linux and Mac)
Copy this simple HTML code and paste it in a new file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--uncomment this. It has no effect in chrome device mode (part of dev tools). It doesn't contain initial-scale=1 on purpose -->
<!--meta name="viewport" content="width=device-width"-->
<title>Initial Scale</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Optio in illo nisi totam eaque ipsam asperiores est nemo dolor ab commodi corporis nostrum voluptas sint corrupti quo obcaecati dolores expedita.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus voluptas facere odio fuga aliquam velit perferendis cum ut officiis ex quia delectus sint alias soluta saepe libero dolor odit exercitationem!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis aut possimus facere necessitatibus nam cumque repudiandae itaque recusandae minus hic exercitationem soluta officia voluptates neque quia maxime voluptatum eaque sed!
</p>
</body>
</html>
Open it with Google Chrome in Device Mode. Emulate any terminal, or even use the responsive mode.
What I expect: Tiny text. Because of the effect explained in this video: The browser will default the width to 980px (typical desktop browser width)
What I get: the text has normal size. Check screenshot
So, first question: Why am I not seeing the text small, like is explained in the video?
UPDATED: My guess: Is Chrome doing font boosting?
Now, second experiment. Just uncomment the meta viewport tag. The aim is to reproduce this zooming effect, caused by the lack of initial-scale=1. So, open the web page in the iPhone 5 emulator, and use portrait/landscape modes.
What I expect: the zoom effect explained in the link. The width of the screen has changed in landscape mode, so, without initial-scale=1, I should see the text zoomed.
What I get: the text keeps the same size in both, portrait and landscape modes. But I'm not applying the initial-scale=1 modifier...
Check screenshots
So, second question: why don't I need initial-scale=1 to make the text look nice in landscape mode?
In this example, it happens as I expect:
Text is tiny at first (no meta viewport)
If I add the meta viewport complete, everything fits properly.
I think it just has something to do with the way that you're formatting those HTML comments.
Without tag:
With tag:
Try adding a space between the <!-- and --> comment delimiters and the comment text.
I don't know the spec that well but I think that your comment format is valid, but for some reason it's causing a bug.
Also note that I'm setting both width and initial-scale which is how the best practices doc recommend it. However, it's working for me when I only set width as you did: