align text of LIs with other elements - html

Our graphic designer sent me the following image for how our page should look:
So the text of the <li> elements should be aligned with the logo at the top and the heading above the list. I can't seem to find a way to specify this relationship precisely. I ended up tweaking the margin-left style of li until they seemed about even with the heading in my browser, but that doesn't seem like it will be reliable across different devices and browsers. There's no direct relationship between padding-left: 1em; on the #image-header and #instruction-header DIVs that contain the first two elements, and margin-left: 1.3em on #instructions li.
Is there a way to style these so that the alignment is assured?
And if I line up the text, can I be sure that the numbers won't end up outside the page boundary?
#image-header {
background-color: #fcfb91;
padding-top: 5px;
padding-left: 1em;
}
.image-container {
display: inline-block;
text-align: center;
vertical-align: middle;
}
#instructions li {
margin-bottom: 1em;
margin-left: -1.3em;
}
#instruction-header {
background-color: #336699;
color: white;
width: 20em;
padding-bottom: 2px;
padding-top: 2px;
padding-left: 1em;
}
<div id="image-header">
<div class="image-container">
<img src="//dev.bridgebase.com/barmar_test/mp/acbl/bbo.png" alt="BBO Logo">
</div>
<div class="image-container">
<img src="//dev.bridgebase.com/barmar_test/mp/acbl/invitetext.png" alt="Invite some friends">
</div>
</div>
<div style='font-family: "Ariel", sans-serif'>
<h3 id="instruction-header">How it works</h3>
<ol id="instructions">
<li>Every friend you invite who has not played an ACBL tournament on BBO is eligible for the promotion.</li>
<li>Each of you will earn BB$5 when your friend creates a BBO username (if he's not already a BBO user) and registers a valid ACBL number. The bonus will be automatically deposited in each of your BBO accounts.
</li>
<li>There is no limit to the number of bonuses you can earn within the deadline of the promotion.</li>
<li>Once you refer, each friend will receive an email from BBO.</li>
<li>The deadline is Nov 1, 2015. Your friend must use that referral email to successfully create a BBO username and register his ACBL number by that date for both of you to earn the bonuses.
</li>
</ol>
</div>

I think you should remove the left margin from #instructions li, and instead define the left-padding of #instructions ol. If you set it to 1em, it perfectly aligns with the logo
Edit: Here you go:
#image-header {
background-color: #fcfb91;
padding-top: 5px;
}
.image-container {
display: inline-block;
text-align: center;
vertical-align: middle;
}
#instructions, #image-header {
padding-left: 1em;
}
#instructions li {
margin-bottom: 1em;
}
#instruction-header {
background-color: #336699;
color: white;
width: 20em;
padding-bottom: 2px;
padding-top: 2px;
padding-left: 1em;
}
<div id="image-header">
<div class="image-container">
<img src="//dev.bridgebase.com/barmar_test/mp/acbl/bbo.png" alt="BBO Logo">
</div>
<div class="image-container">
<img src="//dev.bridgebase.com/barmar_test/mp/acbl/invitetext.png" alt="Invite some friends">
</div>
</div>
<div style='font-family: "Ariel", sans-serif'>
<h3 id="instruction-header">How it works</h3>
<ol id="instructions">
<li>Every friend you invite who has not played an ACBL tournament on BBO is eligible for the promotion.</li>
<li>Each of you will earn BB$5 when your friend creates a BBO username (if he's not already a BBO user) and registers a valid ACBL number. The bonus will be automatically deposited in each of your BBO accounts.
</li>
<li>There is no limit to the number of bonuses you can earn within the deadline of the promotion.</li>
<li>Once you refer, each friend will receive an email from BBO.</li>
<li>The deadline is Nov 1, 2015. Your friend must use that referral email to successfully create a BBO username and register his ACBL number by that date for both of you to earn the bonuses.
</li>
</ol>
</div>

Related

Figure won't stay within border of html

Problem: The image I tried floating to the right floats out of the black border around the html/body element and causes it to have half of the image out of view, it looks like it floated bottom right instead of it just floating right
Why is it that the image wont be contained within the body border?
CSS
html {
padding: 0px;
margin: 0px;
background-color: white;
font-family: Verdana, Tahoma, sans-serif;
a:link,
a:visited {
color: hsl(0, 79%, 43%);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
}
header {
width: 100vw;
}
h1 {
background-color: rgb(134, 0, 0);
position: sticky;
top: 0px;
font-size: 1.2em;
width: 90vw;
padding-top: 10px;
padding-bottom: 10px;
margin-right: auto;
margin-left: auto;
color: white;
padding: 20px
}
.headerNav {
width: 90vw;
margin-left: auto;
margin-right: auto;
padding-bottom: 5px;
text-align: left;
}
ul {
text-decoration-style: dashed;
}
.bodyOfPage {
width: 90vw;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-width: 1px;
border-color: #CCCCC;
border-radius: 10px;
}
h2 {
font-size: 120%;
color: #666666
}
h3 {
color: #9f2424
}
footer {
width: 90vw;
margin-left: auto;
margin-right: auto;
font-size: 80%;
font-style: italic;
color: #666666;
}
a:link,
a:visited {
color: hsl(0, 79%, 43%);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
figure {
float: right;
height: auto;
padding: 10px;
border-style: solid;
border-width: 1px;
border-color: rgb(204, 108, 108);
}
figcaption{
font-style: italic;
color: #666666;
}
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link href='../week2/styles.css' rel='stylesheet'>
<meta charset="UTF-8">
<title>Data Breach Report January to June 2022</title>
</head>
<body>
<header>
<h1>Data Breach Report January to June 2022</h1>
<div class="headerNav">
<nav>
<ul>
<li>
Executive Summary
</li>
<li>
Notifications received
<ul>
<li>
Large Scale Breaches
</li>
</ul>
</li>
<li>
Source of Breaches
<ul>
<li>
Malicious or criminal attacks
</li>
<li>
Cyber Incidents
</li>
<li>
Human Errors
</li>
<li>
System Faults
</li>
</ul>
</li>
</ul>
</nav>
</div>
</header>
<hr>
<div class="bodyOfPage">
<p>The Office of the Australian Information Commissioner (OAIC) periodically publishes <a
href="https://www.oaic.gov.au/privacy/notifiable-data-breaches/notifiable-data-breaches-statistics">statistical
information</a> about notifications received under the <a
href="https://www.oaic.gov.au/privacy/notifiable-data-breaches">Notifiable Data Breaches (NDB)
scheme</a> to help entities and the public understand privacy risks identified through the scheme. This
report captures notifications made under the NDB scheme from 1 January to 30 June 2022.</p>
<p>Statistical comparisons are to the period 1 July to 31 December 2021 unless otherwise indicated.</p>
<p>Where data breaches affect multiple entities, the OAIC may receive multiple notifications relating to the
same incident. Notifications relating to the same incident are counted as a single notification in this
report unless otherwise specified.</p>
<p>The source of any given breach is based on information provided by the reporting entity. Where more than one
source has been identified or is possible, the dominant or most likely source has been selected. Source of
breach categories are defined in the glossary at the end of this report.</p>
<p>Notifications made under the My Health Records Act 2012 are not included as they are subject to specific
notification requirements set out in that Act.</p>
<p>Statistics in this report are current as of 30 September 2022. Some data breach notifications are being
assessed and adjustments may be made to related statistics. This may affect statistics for the period
January to June 2022 published in future reports. Similarly, statistics from before January 2022 in this
report may differ from statistics published in previous NDB reports.</p>
<h2>Executive summary</h2>
<p>The NDB scheme was established in February 2018 to improve consumer protection and drive better security
standards for protecting personal information. Under the scheme, any organisation or government agency
covered by the <a
href="https://www.oaic.gov.au/privacy/the-privacy-act/rights-and-responsibilities/?stage=Stage#OrgAndAgencyPrivacyActCovers">Privacy
Act 1988</a> that experiences an eligible data breach must notify affected individuals and the OAIC.</p>
<p>The OAIC publishes twice-yearly reports on notifications received under the NDB scheme to track the leading
sources of data breaches and highlight emerging issues and areas for ongoing attention by regulated
entities.</p>
<figure>
<img src="/twa/twa021/practicals/images/executive-summary.png" alt="Summary of Breaches" width="656"
height="411">
<figcaption>
Illustrative Summary of the Data Breaches between January and June 2022
</figcaption>
</figure>
<h3>Key findings for the January to June 2022 reporting period:</h3>
<ul>
<li>396 breaches were notified compared to 460 in July to December 2021 (<b>14% decrease</b>).</li>
<li>Malicious or criminal attack remains the leading source of breaches accounting for 250 notifications
(63% of the total), down 1% in number from 253.</li>
<li>Data breaches resulting from <mark>human error accounted for 131 notifications (33% of the total), down
31% in number from 189.</mark></li>
<li>Health remains the highest reporting sector notifying 20% of breaches, followed by finance (13%).</li>
<li>Contact information remains the most common type of personal information involved in breaches.</li>
<li><mark>91% of breaches affected 5,000 individuals or fewer, while 65% affected 100 people or
fewer.</mark></li>
<li><em>71% of entities notified the OAIC within 30 days of becoming aware of an incident.</em></li>
</ul>
</div>
<footer>
<p>Information has been sourced from OAIC and the <a
href="https://www.oaic.gov.au/__data/assets/pdf_file/0020/23663/OAIC-Notifiable-Data-Breaches-Report-Jan-Jun-2022.pdf">Notifiable
Data Breaches Report January to June 2022</a></p>
</footer>
</body>
</html>
I've tried moving the border around the whole body even the footer but it just stays in place
Any help is greatly appreciated :)
Add overflow: auto to .bodyOfPage to completely wrap the floating element in it.

How would I build this with such a background while keeping it responsive in HTML/CSS/Bootstrap?

I am trying to build this design in HTML/CSS (see image below), but I am having trouble getting the background in with the number.
So far I have tried using a background image SVG - but on resize it is either getting stretched or the content does not fit anymore.
What I have so far:
.steps .step {
margin-top: -80px;
margin-bottom: 120px;
}
.steps .step .topblock {
position: relative;
margin-top: 40px;
background-size: contain;
background-repeat: no-repeat;
padding: 60px;
padding-bottom: 80px;
}
.steps .step .topblock .numberholder {
position: absolute;
top: 20px;
left: 0;
right: 0;
text-align: center;
}
.steps .step .topblock .numberholder .number {
color: #FE6631;
font-weight: bold;
border-radius: 50%;
background-color: white;
width: 50px;
height: 50px;
font-size: 24px;
line-height: 47px;
margin: 0 auto;
}
.steps .step .topblock h3 {
padding-top: 40px;
text-align: center;
color: white;
margin-bottom: 30px;
}
.steps .step .topblock ul {
list-style: none;
padding-left: 0;
padding-bottom: 20px;
}
.steps .step .topblock ul li {
text-align: center;
color: white;
}
.steps .step .bottomblock {
text-align: center;
margin-top: -30px;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container steps">
<div class="step">
<div class="topblock" style="background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzc1IiBoZWlnaHQ9IjI1MSIgdmlld0JveD0iMCAwIDM3NSAyNTEiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNDQ1XzMyOCkiPgo8bWFzayBpZD0icGF0aC0xLWluc2lkZS0xXzQ0NV8zMjgiIGZpbGw9IndoaXRlIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMjUgMzVDMjE5LjQ3NyAzNSAyMTUuMTc2IDMwLjM3MjIgMjEzLjE3NiAyNS4yMjQzQzIwOS4yNTkgMTUuMTQ0NyAxOTkuNDY0IDggMTg4IDhDMTc2LjUzNiA4IDE2Ni43NDEgMTUu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yVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0IGR5PSIxNSIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIxMS41Ii8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzQ0NV8zMjgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ1XzMyOCIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K)"
;="">
<div class="numberholder">
<p class="number">1</p>
</div>
<h3>A tailor-made offer</h3>
<ul>
<li>For the (starting) entrepreneur</li>
<li>At least four months of Chamber of Commerce registration</li>
<li>A full lease financing</li>
</ul>
</div>
<div class="bottomblock">
<h3>Full lease financing for entrepreneurs</h3>
<p>Full lease financing for entrepreneurs At there is a unique opportunity for entrepreneurs to fully lease or finance the desired car. The car is then simply owned. But instead of counting down a large amount at once, you pay the...</p>
</div>
</div>
<div class="step">
<div class="topblock" style="background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzc1IiBoZWlnaHQ9IjI1MSIgdmlld0JveD0iMCAwIDM3NSAyNTEiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNDQ1XzMyOCkiPgo8bWFzayBpZD0icGF0aC0xLWluc2lkZS0xXzQ0NV8zMjgiIGZpbGw9IndoaXRlIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMjUgMzVDMjE5LjQ3NyAzNSAyMTUuMTc2IDMwLjM3MjIgMjEzLjE3NiAyNS4yMjQzQzIwOS4yNTkgMTUuMTQ0NyAxOTkuNDY0IDggMTg4IDhDMTc2LjUzNiA4IDE2Ni43NDEgMTUuMTQ0NyAxNjIuODI0IDI1LjIyNDNDMTYwLjgyNCAzMC4zNzIyIDE1Ni41MjMgMzUgMTUxIDM1SDIyLjY1NzRDMTguNTQ0IDM1IDE1LjMxNzMgMzguNTI5OCAxNS42ODU1IDQyLjYyNjdMMzAuNDI3MSAyMDYuNjI3QzMwLjc1MTUgMjEwLjIzNSAzMy43NzU5IDIxMyAzNy4zOTkgMjEzSDMzNy42MDFDMzQxLjIyNCAyMTMgMzQ0LjI0OSAyMTAuMjM1IDM0NC41NzMgMjA2LjYyN0wzNTkuMzE0IDQyLjYyNjdDMzU5LjY4MyAzOC41Mjk4IDM1Ni40NTYgMzUgMzUyLjM0MyAzNUgyMjVaIi8+CjwvbWFzaz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMjUgMzVDMjE5LjQ3NyAzNSAyMTUuMTc2IDMwLjM3MjIgMj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hbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzQ0NV8zMjgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ1XzMyOCIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K)"
;="">
<div class="numberholder">
<p class="number">2</p>
</div>
<h3>At a competitive financial lease rate</h3>
<ul>
<li>Annual figures without transfer</li>
<li>Lease or financing with renowned lease and financing partners</li>
<li>At attractive conditions</li>
</ul>
</div>
<div class="bottomblock">
<h3>Leasing or financing has never been easier</h3>
<p>In order to be able to offer the best conditions, we quickly and professionally compare all quotations from our lease and financing partners. We then offer you the best offer, fully customized. Without you having to worry about this or put in the
time. No financial statements, ...</p>
</div>
</div>
<div class="step">
<div class="topblock" style="background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzc1IiBoZWlnaHQ9IjI1MSIgdmlld0JveD0iMCAwIDM3NSAyNTEiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNDQ1XzMyOCkiPgo8bWFzayBpZD0icGF0aC0xLWluc2lkZS0xXzQ0NV8zMjgiIGZpbGw9IndoaXRlIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMjUgMzVDMjE5LjQ3NyAzNSAyMTUuMTc2IDMwLjM3MjIgMjEzLjE3NiAyNS4yMjQzQzIwOS4yNTkgMTUuMTQ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9IjAiIHdpZHRoPSIzODkuNjg2IiBoZWlnaHQ9IjI1MSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0IGR5PSIxNSIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIxMS41Ii8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNSAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzQ0NV8zMjgiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ1XzMyOCIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K)"
;="">
<div class="numberholder">
<p class="number">3</p>
</div>
<h3>Arranged within 24 hours</h3>
<ul>
<li>Good advice about monthly payments</li>
<li>All-in lease price: you know exactly where you stand in advance</li>
<li>The car is directly your property</li>
</ul>
</div>
<div class="bottomblock">
<h3>We advise you on which car fits which monthly costs</h3>
<p>In addition, protects you from too high charges. We use an automated credit check based on financial data from the Chamber of Commerce. If these figures show that the monthly costs for the car you have selected are too high, we will draw
your attention to this....</p>
</div>
</div>
</div>
This only gives me the correct result on a certain viewport width and does not work well responsive.
Thanks in advance
screenshot of design that I need to convert to HTML/CSS
What I have so far (which looks almost correct on this viewport width)
What happens on smaller screens
What happens on bigger screens
I have checked your screenshots and tried for myself. So basically what your problem is your background image doesn't stick in the middle so to correct add this code:
background-position: center;
to this class
.steps .step .topblock {
this will fix this problem for all screens other than mobile i think.
How it is suppose to look :
.steps .step .topblock {
position: relative;
margin-top: 40px;
background-size: contain;
background-repeat: no-repeat;
padding: 60px;
padding-bottom: 80px;
background-position: center;
}
and about your mobile responsiveness problem you need to work with media queries.
and since your background has a static height because you used (background-size: contain;)
you need to change that to make it look better on phone and that would be this code that covers the background instead of trying to contain itself into a small area:
#media only screen and (max-width: 780px) {
.steps .step .topblock {
background-size: cover;
}
Glad to be help. Let me know if you have questions!

How to center text at the bottom of a div

I have a website with some cards on it. The cards have 3 pieces of text, a main header, a paragraph, and another header (h2) at the bottom. I want second headers from each card to be the same distance from the bottom of the card. I have tried using some absolute and relative positioning, but I think there are some margins or something that are blocking me from keeping that header centered at the bottom of the card. Can someone help me?
<section id="lifeSkillsSection">
<h1 class="courseSectionHeader">Life Skills</h1>
<!--begin building course cards\-->
<div class= "courseContainer">
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Basics of Personal Finance</h1>
<p class="courseDescription">Sign up for this class to learn all the critical topics and rules of personal finance.
Upon completion of this course, you will know how to build a budget, balance
a checkbook, the basics of financing a car or house, and more! We reccomend that all
Nehemiah Family Members without a broad understanding of personal finance
take this course. Click this card to sign up!
</p>
<h2 class="timeLength">This course has 3 classes and 1 qualification test.</h2>
</div>
</div>
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Principles of Manufacturing</h1>
<p class="courseDescription">Sign up for this class to learn about all the critical elements of consumer goods manufacturing.
Upon completion of this course, you will know how operations and supply chains work together,
how manufacturing plants analyze data, the basic principles of quality assurance, and more! We reccomend that all
Nehemiah Family Members take this course. Click this card to sign up!
</p>
<h2 class="timeLength">This course has 4 classes and 1 qualification test.</h2>
</div>
</div>
</div>
<!--next row of cards-->
<div class= "courseContainer">
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Faith and Spiritual Healing</h1>
<p class="courseDescription">Are you a person of faith? Do you want to dive deeper into your spirituality? This course focuses
on the main principles of faith and spirituality to encourage students to always seek a higher understanding.
We want our Family Members to be passionate about their faith and give them an opportunity to learn more and express
their spiritual desires. Click this card to sign up for this course!
</p>
<h2 class="timeLength">This course has 3 classes.</h2>
</div>
</div>
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Foundations of Family & Parenthood</h1>
<p class="courseDescription">In this class we teach what it takes to be an effective parent and develop a strong and healthy relationship
with your family. Learn about the basics of raising an infant, important techniques and strategies to help your children grow,
fun things you can do to bring your family together, and more! Click this card to sign up for the course!
</p>
<h2 class="timeLength">This course has 3 classes.</h2>
</div>
</div>
</div>
</section>
Here is my css
.courseSectionHeader{
text-align: center;
font-family: "Source Sans Pro", sans-serif;
font-size: 40px;
margin-top: 40px;
}
/*size containers and cards so that they can stretch as screen size changes*/
.courseContainer{
display: flex;
justify-content: center;
flex-direction: row;
}
.courseCard{
display: flex;
padding: 30px;
margin-left: 5%;
margin-right: 5%;
margin-top: 40px;
margin-bottom: 40px;
width: 500px;
height: auto;
border-radius: 18px;
background: #800400;
box-shadow: 5px 5px 15px rgba(0,0,0,0.9);
text-align: center;
justify-content: center;
font-family: "Source Sans Pro", sans-serif;
}
.courseCard:hover{
background-color: #c0221d;
cursor: pointer;
}
.courseText{
font-family: "Source Sans Pro",sans-serif;
color: white;
}
.courseHeader{
font-weight:900;
}
.courseDescription{
margin-top: 10%;
}
.timeLength{
margin-bottom: 5%;
margin-top: auto;
}
Can someone help me figure out how to have all those bottom headers the same distance from the bottom of the card?
You could use flexbox to solve it. This issue is more likely to be titled: How can I center a child element at the bottom of a parent element.
Anyway, you could try adding these styles to your existing rules:
/* flex-container */
.courseCard {
display: flex;
flex-direction: column;
}
/* This rule remains the same. It's a flex-item */
.timeLength{
margin-bottom: 5%;
margin-top: auto;
}
If you apply auto margins to a flex item, that item will automatically extend its specified margin to occupy the extra space in the flex container, depending on the direction in which the auto-margin is applied.
Read more: https://css-tricks.com/the-peculiar-magic-of-flexbox-and-auto-margins/
I would add position style to your element you want to add to bottom of card, and one more position style to parent element. So, it is position: relative to <div class="courseCard" and position: absolute; bottom: 0px <h2 class="timeLength"
.courseSectionHeader{
text-align: center;
font-family: "Source Sans Pro", sans-serif;
font-size: 40px;
margin-top: 40px;
}
/*size containers and cards so that they can stretch as screen size changes*/
.courseContainer{
display: flex;
justify-content: center;
flex-direction: row;
}
.courseCard{
display: flex;
padding: 30px;
margin-left: 5%;
margin-right: 5%;
margin-top: 40px;
margin-bottom: 40px;
width: 500px;
height: 600px;
border-radius: 18px;
background: #800400;
box-shadow: 5px 5px 15px rgba(0,0,0,0.9);
text-align: center;
justify-content: center;
font-family: "Source Sans Pro", sans-serif;
position: relative;
}
.courseCard:hover{
background-color: #c0221d;
cursor: pointer;
}
.courseText{
font-family: "Source Sans Pro",sans-serif;
color: white;
}
.courseHeader{
font-weight:900;
}
.courseDescription{
margin-top: 10%;
}
.timeLength{
margin-bottom: 5%;
margin-top: auto;
position: absolute;
bottom: 0px;
}
<section id="lifeSkillsSection">
<h1 class="courseSectionHeader">Life Skills</h1>
<!--begin building course cards\-->
<div class= "courseContainer">
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Basics of Personal Finance</h1>
<p class="courseDescription">Sign up for this class to learn all the critical topics and rules of personal finance.
Upon completion of this course, you will know how to build a budget, balance
a checkbook, the basics of financing a car or house, and more! We reccomend that all
Nehemiah Family Members without a broad understanding of personal finance
take this course. Click this card to sign up!
</p>
<h2 class="timeLength">This course has 3 classes and 1 qualification test.</h2>
</div>
</div>
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Principles of Manufacturing</h1>
<p class="courseDescription">Sign up for this class to learn about all the critical elements of consumer goods manufacturing.
Upon completion of this course, you will know how operations and supply chains work together,
how manufacturing plants analyze data, the basic principles of quality assurance, and more! We reccomend that all
Nehemiah Family Members take this course. Click this card to sign up!
</p>
<h2 class="timeLength">This course has 4 classes and 1 qualification test.</h2>
</div>
</div>
</div>
<!--next row of cards-->
<div class= "courseContainer">
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Faith and Spiritual Healing</h1>
<p class="courseDescription">Are you a person of faith? Do you want to dive deeper into your spirituality? This course focuses
on the main principles of faith and spirituality to encourage students to always seek a higher understanding.
We want our Family Members to be passionate about their faith and give them an opportunity to learn more and express
their spiritual desires. Click this card to sign up for this course!
</p>
<h2 class="timeLength">This course has 3 classes.</h2>
</div>
</div>
<div class="courseCard">
<div class="courseText">
<h1 class= "courseHeader">Foundations of Family & Parenthood</h1>
<p class="courseDescription">In this class we teach what it takes to be an effective parent and develop a strong and healthy relationship
with your family. Learn about the basics of raising an infant, important techniques and strategies to help your children grow,
fun things you can do to bring your family together, and more! Click this card to sign up for the course!
</p>
<h2 class="timeLength">This course has 3 classes.</h2>
</div>
</div>
</div>
</section>

Text goes outside of footer when I shrink the browser

I have created a static website using html and css, the problem is that when I shrink the browser the text inside of the footer goes outside of the footer, how can I make so that the text always stays in the footer regardless of whether I shrink the browser or not?
* {
margin: 0px;
padding: 0px;
}
.nav-h1 {
text-align: center;
margin-top: 27px;
font-family: 'Open Sans';
font-size: 40px;
}
.nav {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
}
a {
display: inline-block;
margin: 10px;
font-family: 'Open Sans';
color: black;
font-weight: bold;
}
.a-container {
margin-left: 10%;
margin-top: 27px;
}
.logo-section {
margin-left: 15px;
margin-top: 15px;
}
.main {
min-height: calc(100vh - 70px);
background-color:#F1F1F1;
overflow: hidden;
}
.footer {
width: 100%;
height: 100%;
background-color: black;
color: gray;
font-family: 'Open Sans';
font-size: 15px;
}
.first-box {
width: 45%;
margin: 0 auto;
margin-top: 50px;
}
.first-box-text {
margin-top: 20px;
font-family: 'Open Sans';
}
.centered-p {
text-align: center;
margin-top: 20px;
font-family: 'Open Sans';
}
.second-word {
color: #ffa200;
text-decoration: underline;
}
.centered-img{
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
}
.header {
height: 8%;
}
.logo-img {
margin-top: 10px;
height: 50px;
}
.flex-container {
display: flex;
margin-top: 50px;
margin-left: 17%;
}
section {
flex: 2;
}
aside {
flex: 1;
}
.bordered-div {
margin-top: 50px;
text-align: center;
padding: 15px;
font-family: 'Open Sans';
font-size: 25px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
.flex-container-first-section-a {
color: #ffa200;
text-decoration: none;
border-bottom: 2px solid #ffa200;
}
.aside-first-section {
width: 60%;
text-align: center;
padding: 15px;
margin-left: 50px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
.aside-img {
margin-left: 50px;
margin-top: 20px;
}
.third-section {
margin-top: 25px;
font-family: 'Open Sans';
}
.forth-section-h1{
margin-left: 28%;
margin-top: 50px;
font-family: 'Open Sans';
}
.forth-section-p {
margin-left: 90px;
margin-top: 40px;
font-family: 'Open Sans';
}
.bordered-div-h1-upper-case {
text-transform: uppercase;
}
.image-container {
display: flex;
margin-top: 30px;
}
.image-container-img {
padding: 5px;
}
.img-with-text {
margin: 10px;
font-family: 'Open Sans';
}
.img-with-text-span {
border-top: solid 3px #ffa200
}
.second-section {
margin-top: 10px;
font-family: 'Open Sans';
}
.bottom-message {
height: 300px;
width: 100%;
margin-top: 50px;
margin-bottom: 50px;
text-align: center;
border: solid 2px black;
}
.bottom-message-button {
width: 50%;
height: 15%;
margin-top: 50px;
background-color: #ffa200;
border-radius: 4px;
border: none;
color: white;
font-family: 'Open Sans';
font-size: 20px;
font-weight: bold;
}
.bottom-message-content {
margin-top: 60px;
margin: 70px;
}
.centered-heading {
font-family: 'Open Sans';
}
.flex-container-first-p {
font-family: 'Open Sans';
}
.bottom-message-h1, .bottom-message-content-p {
font-family: 'Open Sans';
margin-top: 20px;
}
.footer-section {
width: 50%;
margin: 0 auto;
}
.footer-content {
margin: 0px;
padding: 0px;
}
.footer-links-a {
color: gray;
text-decoration: none;
border-right: 1px solid;
padding-right: 23px;
}
.capital-words {
text-transform: uppercase;
padding-top: 10px;
}
.footer-links {
width: 800px;
margin: 0 auto;
margin-top: 50px;
}
.copyright-p {
padding-top: 10px;
}
.aside-h2 {
font-size: 15px;
text-align: center;
margin-top: 10px;
}
.aside-third-section > img {
height: 250px;
}
.line {
border-bottom: solid 2px black;
width: 70%;
margin: 0 auto;
padding-top: 50px;
}
.box-message {
height: 200px;
width: 280px;
margin-top: 50px;
margin-left: 80px;
border: solid 2px black;
}
.box-message-p {
font-family: 'Open Sans';
margin-top: 50px;
width: 60%;
margin: 0 auto;
margin-top: 35px;
font-size: 15px;
}
.box-message-button, .box-message-a {
margin-top: 30px;
margin-left: 70px;
}
.box-message-a {
color: #ffa200;
text-decoration: none;
border-bottom: solid 2px #ffa200;
font-size: 25px;
}
.trending-news-div {
width: 60%;
text-align: center;
padding: 15px;
margin-left: 70px;
margin-top: 50px;
border-top: solid 2px gray;
border-bottom: solid 2px gray;
}
<div class="container">
<div class="header">
<div class="nav">
<h1 class="nav-h1">Nip & Tuck</h1>
<div class="a-container">
<a>Lifestyle</a>
<a>Culture</a>
<a>Sports</a>
<a>Politics</a>
</div>
<div class="logo-section">
<img class="logo-img" src="/assets/images/twitter-logo.PNG" alt="twitter logo">
<img class="logo-img"src="/assets/images/youtube-logo.png" alt="youtube logo">
<img class="logo-img"src="/assets/images/facebook-logo.png" alt="facebook logo">
</div>
</div>
</div>
<div class="main">
<div class="first-box">
<h1 class="centered-heading">How one woman gave her boss, her ex-boyfriend and all her doubters, the big middle finger</h1>
<p class="first-box-text">Janice Allbright decided enough was enough. It was time to change her life. After six months of stock trading, the final result was renewed confidence, increased happiness and £128,405!
</p>
<p class="centered-p">By
<a class="second-word">Kelly Chang</a>
| 30.06.2020</p>
<img src="/assets/images/center-image.png" alt="woman carrying a bag" class="centered-img">
<p class="centered-p">"It's not arrogance, it's confidence"</p>
</div>
<div class="flex-container">
<section>
<p class="flex-container-first-p">
“My life was basically sh!t, says Janice Allbright, a single woman whose life was literally in the toilet six months ago. “I was working at a shop on the high street, earning next to nothing. Then I would go home to my abusive boyfriend. Not exactly a fairytale life.” Everything changed for Janice when she discovered online trading while killing time on her lunch break. “My colleagues, friends and boyfriend at the time all doubted me. Now I’m the queen bitch, laughing at their tears.”
</p>
<div class="bordered-div">
<p>Change your life with the Online Investing System</p>
<a class="flex-container-first-section-a" href="">Get started for free</a>
</div>
<img src="/assets/images/second-center-image.PNG" alt="woman talking on the phone" class="centered-img">
<p class="centered-p">A new and better life</p>
<section class="second-section">
<p>Janice credits her amazing financial success to trading stocks online. The highschool dropout had concerns at the beginning, due to her lack of financial knowledge and experience. “It turned out there was nothing to worry about,” she says. “My broker provided me with all of the training and tools I needed to become a successful stock trader. Their patience was amazing.” </p>
</section>
<section class="third-section">
<p>Brokers and platforms, like the Online Investing System, have turned novice investors into financial superheroes. People like Janice have taken advantage of some tough competition amongst brokers to get the best services for lower prices. Sometimes even for free. “I didn’t have any money for fancy financial tools or software. But lucky me, my broker gave me everything for free.”</p>
</section>
<section class="forth-section">
<img src="/assets/images/third-center-image.PNG" alt="" class="centered-img">
<h1 class="forth-section-h1">"Now I do whatever the f#ack I want when I f#cking want"</h1>
<p class="forth-section-p">Janice believes that her success has given her the confidence to deal with anything life throws her way. And she openly admits that displaying her wealth has become a guilty pleasure. “I was driving in my G Wagon a few weeks ago and noticed my ex-boyfriend waiting at the bus stop. I could resist. I stopped my car, rolled down the window and happily presented my middle finger. I drove away with a smile. Life is good.”</p>
</section>
<div class="bordered-div">
<p>Learn more about online stock trading and how you can profit </p>
<a class="flex-container-first-section-a" href="">Start Now</a>
</div>
<div class="bordered-div">
<h1 class="bordered-div-h1-upper-case">Celebrity News </h1>
</div>
<div class="image-container">
<div class="img-with-text">
<img src="/assets/images/hollywood-image.PNG" alt="hollywod sign" class="image-container-img">
<div class="img-with-text-bottom">
<h4 class="img-with-text-h4">Ass-tastic! We rank the best bums in Hollywood.</h4>
<span class="img-with-text-span">By Lili Johnson 30.06.2020</span>
</div>
</div>
<div class="img-with-text">
<div class="img-with-text-bottom">
<img src="/assets/images/laptop-image.PNG" alt="a picture of a laptop" class="image-container-img">
<h4 class="img-with-text-h4">Coming soon to Netflix. See which movies have us hot and bothered.</h4>
<span class="img-with-text-span">By Gavin Lewis 30.06.2020</span>
</div>
</div>
<div class="img-with-text">
<img src="/assets/images/couple-fighting-image.PNG" alt="a picture of a couple fighting" class="image-container-img">
<h4 class="img-with-text-h4">Another celebrity couple calls it quits. Why can't the rich and famous stay together?</h4>
<span class="img-with-text-span">By Adriana Huber 30.06.2020</span>
</div>
</div>
<div class="bottom-message">
<div class="bottom-message-content">
<h1 class="bottom-message-h1">The rich are getting richer</h1>
<p class="bottom-message-content-p">And so can you. By becoming an online trader of currencies, stocks and commodities, you too can increase your monthly income and upgrade your standard of living </p>
<button class="bottom-message-button">Start with free 1-on-1 coaching</button>
</div>
</div>
</section>
<aside>
<div class="aside-first-section">
<h3>Hot Topics</h3>
</div>
<div class="aside-second-section">
<img src="/assets/images/second-column-first-img.PNG" alt="" class="aside-img">
<h2 class="aside-h2">Man steals £ 2,500,000 from the <br> bank with a legal loophole!</h2>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-second-img.PNG" alt="" class="aside-img">
<h2 class="aside-h2">Does praying to God for money <br> actually work?</h2>
</div>
<div class="line"></div>
<div class="aside-third-section">
<img src="/assets/images/second-column-sixth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Japanese scientists have <br> discovored the secret of making money. Find out if it's real.</h2>
</div>
<div class="box-message">
<div class="box-message-content">
<p class="box-message-p">Learn more about online stock trading and how you can profit.</p>
<a class="box-message-a" href="">Start Now</a>
</div>
</div>
<div class="trending-news-div">
<h3>Trending Financial News</h3>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-third-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Royal family goes bancrupt. <br> Could be out on the streets very soon.</h2>
</div>
<div class="line"></div>
<div class="aside-third-section">
<img src="/assets/images/second-column-forth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Man wins the lottery and blows it <br> all in a Spanish casino.</h2>
</div>
<div class="aside-third-section">
<img src="/assets/images/second-column-fifth-image.png" alt="" class="aside-img">
<h2 class="aside-h2">Silver vs Gold. Our experts give <br> you the breakdown.</h2>
</div>
</aside>
</div>
</div>
<div class="footer">
<section class="footer-section">
<div class="footer-content">
<p class="capital-words">TERMS AND CONDITIONS CAREFULLY READ AND AGREE TO TERMS BELOW:</p>
<br>
<p>We are not affiliated in any way with any news publication. All trademarks on this web site whether registered or not, are the property of their respective owners. The authors of this web site are not sponsored by or affiliated with any of the third-party trade mark or third-party registered trade mark owners, and make no representations about them, their owners, their products or services. It is important to note that this site and the comments/answers depicted above is to be used as an illustrative example of what some individuals have achieved with this/these products. The website, and any page on the website, is based loosely off a true story, but has been modified in multiple ways including, but not limited to: the story, the photos, and the comments. Thus, this page, and any page on this website, are not to be taken literally or as a non-fiction story. Ther page, and the results mentioned on this page, although achievable for some, are not to be construed as the results that you may achieve on the same routine. I UNDERSTAND THIS WEBSITE IS ONLY ILLUSTRATIVE OF WHAT MIGHT BE ACHIEVABLE FROM USING THIS/THESE PRODUCTS, AND THAT THE STORY/COMMENTS DEPICTED ABOVE IS NOT TO BE TAKEN LITERALLY. Ther page receives compensation for clicks on or purchase of products featured on this site.</p><br>
<p class="capital-words">IMPORTANT CONSUMER DISCLOSURE</p><br>
<p>The term "advertorial" is a combination of "advertisement" and "editorial" written in an editorial format as an independent news story, when in fact the advertisement may promote a particular product or interest. Advertorials take factual information and report it in an editorial format to allow the author, often a company marketing its products, to enhance or explain certain elements to maintain the reader's interest. A familiar example is an airline's in-flight magazines that provide an editorial reports about travel destinations to which the airline flies.</p><br>
<p>As an advertorial, I UNDERSTAND THIS WEBSITE IS ONLY ILLUSTRATIVE OF WHAT MIGHT BE ACHIEVABLE FROM USING THIS PROGRAM, AND THAT THE STORY DEPICTED ABOVE IS NOT TO BE TAKEN LITERALLY. Ther page receives compensation for clicks on or purchase of products featured on this site. Ther program is not a job but an educational opportunity that can help individuals learn how to earn money through their entrepreneurial efforts. Anyone who decides to buy any program about making money will not necessarily make money simply by purchasing the program. People who think "I bought these materials so I'm going to automatically make money" are wrong. As any type of education has so many variables, it is impossible to accurately state what you may expect to achieve, however, people who bought the program not only bought the program, but also undertook additional training and education, applied the principles to an area of the market that was growing, kept their commitments and continued to learn. If you do what the individuals depicted did, you may generally expect to achieve a great education in the area of your choice, but you should not expect to earn any specific amount of money. Typical users of the starter materials that don't enroll in coaching, don't keep their commitments and don't implement what they learn, generally make no money. Though the success of the depicted individual is true, her picture and name have been changed to protect her identity. Consistent with the advertorial concept, the comments posted in the comment section are also representative of typical comments and experiences which have been compiled into a comment format to illustrate a dialogue, however, the comments are not actual posts to this webpage and have been compiled or generated for illustrative purposes only.</p><br>
<p>We are not affiliated in any way with CNN, WebTV, News Channel 1, ABC, NBC, CBS, U.S. News or FOX, and all such trademarks on this web site, whether registered or not, are the property of their respective owners. The authors of this web site are not sponsored by or affiliated with any of the third-party trade mark or third-party registered trade mark owners, and make no representations about them, their owners, their products or services.</p>
</div>
<div class="footer-links">
<a class="footer-links-a" href="">Cookie Policy</a>
<a class="footer-links-a" href="">Privacy Policy</a>
<a class="footer-links-a" href="">Data Processing Agreement</a>
<a class="footer-links-a" href="">Terms and Conditions</a>
</div>
<p class="testimonials-p">*Testimonials:
All characters, information and events depicted on This Website are entirely fictitious. Any similarity to actual events or persons, living or dead, is purely coincidental.</p>
<p class="copyright-p">© fortunetonight.com 2020</p>
</section>
</div>
</div>
I tried setting the width in pixels and ems but that still doesn't fix the issue
You have a width of 800px set on .footer-links
That means, no matter how wide your window is, it will keep it at 800px which will make you scroll side to side.
Change the width of .footer-links to be 100% or just remove it all together and that should fix it.
You could use the #media rule in your css..
#media(max-width: 1000px){
.footer-links {
width: 600px;
margin: 0 auto;
margin-top: 50px;
}
}
Link to more on #media --> https://www.w3schools.com/cssref/css3_pr_mediaquery.asp

I cant align my <twittercontainer> div to the right of <srun> and <mentor>; I also can't seem to control the hight of the twitter embed

I can't get my twittercontainer to sit on the right of srun and mentor and I cant seem to change the height of twittercontainer please help. I just need to understand how to get this simply layout of essentially two divs in a column with another div to the right.
I have tried just about every which way I can think of.
<div class="newsbox">
<div class="newboxcontent">
<div class="srun">
<img src="resources/sponsoredrun.jpg" align="left">
<h1>Sponsored Run</h1>
<h2>Six of our supporters ran 10k in Richmond on March 24th 2012
in order to raise money to help us continue our work. They
had
a great deal of fun and raised £1400! </h2>
</div>
<div class="mentor">
<img src="resources/volunteermentors.jpg" align="left">
<h1>Sponsored Run 2</h1>
<h2>We are now accepting applications from those who would like
to take part in our next training course for volunteer
mentors which will take place in June 2012. Topics covered
will include: promoting choice and self awareness in young
people, reflective practice, confidentiality, anger and
aggression, substance misuse, the youth justice system,
</div>
<div class="twittercontainer">
<a class="twitter-timeline" href="https://twitter.com/BelongLondon?ref_src=twsrc%5Etfw">Tweets by BelongLondon</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
.newsbox {
display: flex;
flex-flow: column;
flex-grow: 1;
flex-wrap: wrap;
}
.newboxcontent {
flex-flow: column;
display: flex;
}
.srun {
padding right: 50px;
padding bottom: 50px;
}
.srun h2 {
font-size: 15px;
}
.srun img {
padding: 20px;
}
.mentor h2 {
font-size: 15px;
}
.mentor img {
padding: 20px;
}
.mentor {
padding-right: 50px;
padding top: 100px;
}
.twittercontainer{
width: 200px;
height: 100px;
}
I just want the <twittercontainer> (twitter feed) to sit on the
right of the two other divs and stretch to the same height.
Remove flex direction column from the outer most div .newsbox, you also dont want that wrapper to allow its children to wrap. As mentioned in some of the comments you were missing a few HTML closing tabs which usually introduces some unexpected result.
.newsbox {
display: flex;
}
.newboxcontent {
flex-flow: column;
display: flex;
}
.srun {
padding right: 50px;
padding bottom: 50px;
}
.srun h2 {
font-size: 15px;
}
.srun img {
padding: 20px;
}
.mentor h2 {
font-size: 15px;
}
.mentor img {
padding: 20px;
}
.mentor {
padding-right: 50px;
padding top: 100px;
}
.twittercontainer{
width: 200px;
height: 100px;
}
<div class="newsbox">
<div class="newboxcontent">
<div class="srun">
<img src="resources/sponsoredrun.jpg" align="left">
<h1>Sponsored Run</h1>
<h2>Six of our supporters ran 10k in Richmond on March 24th 2012 in order to raise money to help us continue our work. They had a great deal of fun and raised £1400!</h2>
</div>
<div class="mentor">
<img src="resources/volunteermentors.jpg" align="left">
<h1>Sponsored Run 2</h1>
<h2>We are now accepting applications from those who would like to take part in our next training course for volunteer mentors which will take place in June 2012. Topics covered will include: promoting choice and self awareness in young people, reflective practice, confidentiality, anger and aggression, substance misuse, the youth justice system</h2>
</div>
</div>
<div class="twittercontainer">
<a class="twitter-timeline" href="https://twitter.com/BelongLondon?ref_src=twsrc%5Etfw">Tweets by BelongLondon</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>