We'll be using really similar attributes from last time! You should start getting familiar with these attributes.
background-image
background-position
background-size
background-color
padding
margin
color
font-size
font-style
font-family
font-weight
border-radius
max-width
width
height
transform
transition
text-center
: center align your text (same as just saying text-align: center
)container
: make the div section go to the center and max-width is 1140pxmy-3
: 1rem margin, in the y-direction (top and bottom). For more cool tricks like these, check out the classes at Bootstrap spacingdiv
.<div class="bg-light section-padding" id="portfolio">
<div class="container">
<div class="text-center">
<h2 class="section-heading">PORTFOLIO</h2>
<h3>Lorem ipsum dolor sit amet consectetur.</h3>
</div>
<div class="row">
<div class="col-lg-4">card will be here</div>
<div class="col-lg-4">card will be here</div>
<div class="col-lg-4">card will be here</div>
<div class="col-lg-4">card will be here</div>
<div class="col-lg-4">card will be here</div>
<div class="col-lg-4">card will be here</div>
</div>
</div>
</div>
src
below with the address to another image, or you'll just see a broken image.<div class="card">
<img
src="..."
class="card-img-top"
/>
<div class="card-body">
<div>Window</div>
<div>Photography</div>
</div>
</div>
/* this is for entire section spacing. */
.section-padding {
padding-top: 96px;
padding-bottom: 96px;
}
/* this is for title of section. be sure you have installed the right font! */
.section-heading {
font-size: 40px;
margin-bottom: 16px;
font-family: "Montserrat";
font-weight: 700;
}
/* this is for sub title of section */
.section-subheading {
margin-bottom: 64px;
}
/* this is for each card title. be sure you have the right font! */
.portfolio-caption-heading {
font-size: 24px;
font-family: "Montserrat";
font-weight: 700;
}
/* this is for each card spacing */
.card {
margin-bottom: 32px;
}
/* :hover is a rule that applies when the user's mouse is hovered over a .card element */
.card:hover {
background-color: rgba(255, 238, 0, 0.5);
transform: scale(1.05);
transition: 0.25s;
}
/* this is so that all the images will be resized to a fixed height so the cards won't have mismatching heights */
.card-img-top {
height: 200px;
object-fit: cover;
}
Fontawesome is a website that provides you some cute icons. Instead of downloading a zillion images, it's much more convenient to use this font.
head
tag.<script src="https://use.fontawesome.com/releases/v5.15.1/js/all.js" crossorigin="anonymous"></script>
<i>
tag. All you need to do is copy that <i>
tag and put into your html body anywhere you want. For example, let's search for "Earth". You should see this: <i>
tag on the new page: Actually, this section is easier than the portfolio, so maybe we should've started here ;). Think upon the structure again.
<div class="section-padding" id="skill">
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="section-heading">Skill</h2>
<h3 class="section-subheading text-muted">Lorem ipsum dolor sit amet consectetur.</h3>
</div>
</div>
<div class="row">
<div class="col-lg-3">card will be here</div>
<div class="col-lg-3">card will be here</div>
<div class="col-lg-3">card will be here</div>
<div class="col-lg-3">card will be here</div>
</div>
</div>
</div>
<i>
tags:<div class="row text-center">
<div class="col-lg-3">
<i class="far fa-file-code icon-style"></i>
<h4 class="my-3">HTML/CSS</h4>
<p class="text-muted">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima maxime quam architecto quo inventore harum ex magni, dicta impedit.
</p>
</div>
</div>
.icon-style {
font-weight: 800;
font-size: 128px;
color: rgb(255, 187, 0);
}
Now, we get to work a bit more with the "grid".
<div class="bg-light section-padding" id="experience">
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="section-heading">Experience</h2>
<h3 class="section-subheading text-muted">Lorem ipsum dolor sit amet consectetur.</h3>
</div>
</div>
<div class="row experience-row">
<div class="col-lg-10">Some text</div>
<div class="col-lg-2 experience-date">Some date</div>
</div>
<div class="row experience-row">
<div class="col-lg-10">Some text</div>
<div class="col-lg-2 experience-date">Some date</div>
</div>
</div>
</div>
<div class="row experience-row">
<div class="col-lg-10">
<h3>FULL STACK WEB DEVELOPMENT INSTRUCTOR</h3>
<h4>CoderSchool</h4>
<p>
Writing the world's best assignments to teach the principles of HTML, CSS, which are incredibly difficult. Just kidding, we find it really easy and hope you do too!
</p>
</div>
<div class="col-lg-2 experience-date">
<span>03.2013 - 03.2022</span>
</div>
</div>
.experience-date {
color: orange;
font-weight: bold;
}
Let's make a bonus feature!
data-toggle
: This means that this element has the power to toggle things, which means to set things on or off. This can toggle a modal.data-target
: The id
of the target modal. When you click the card, the modal with this id will open up. This should begin with a #
.id
: id for each modal. It's the same id used in the data-target
attribute for the correspoding card. This value should be unique for each modal.data-toggle
and data-target
will be moved to the portfolio cards instead).Put this code under the Experience Section.
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">...</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<div class="modal-body">