I've created a landing page that has a lot of alignment issues on bigger screens, despite having a lot of {margin: auto;} functions. Not sure what is wrong.
Additional issues:
1) small white space to the left of the showcase banner
2) white space at the bottom of the page, below footer
3) yellow line in the middle should be in line with title (Featured Speaker)
4) Yellow button CTA not wrapping nicely
Any help with anything listed would be much appreciated.
Thanks!
1)
<!-- Showcase Section-->
<div id="showcase">
<header>
<nav class="cf">
<ul class="cf">
<li class="hide-on-small">
<a href="https://www.centro.net/">
<img src="https://www2.centro.net/l/75412/2019-01-
15/4kzjqb/75412/179423/Centro_Webinar_logo.png" alt="Centro Webinars">
</a>
</li>
</ul>
<a href="#" id='openup'>Centro Webinars</a>
</nav>
</header>
/* Showcase */
#showcase {
margin: 0;
padding: 0;
padding-bottom: 20px;
background: url('https://www2.centro.net/l/75412/2019-01-
15/4kzjql/75412/179431/herotallerwider.png') no-repeat center/cover;
width: 100%;
position: relative;
overflow-y: hidden;
}
#showcase .container {
margin-top: 13vh;
margin-left: 0vw;
margin-right: 43vw;
}
#showcase h1 {
margin-left: 7vw;
font-size: 1.5rem;
margin-bottom: -0.1em;
color: #1fadde;
}
#showcase h3 {
margin-left: 7vw;
font-size: 0.9rem;
margin-bottom: -1.3em;
color: #3a3d40;
}
#showcase h2 {
margin-left: 7vw;
font-size: 1.2rem;
margin-bottom: -0.5em;
color: #1fadde;
}
#showcase p {
margin-left: 7vw;
font-size: 14px;
margin-bottom: -0.5em;
color: #3a3d40;
width: 70%;
}
2)
/* Footer */
footer .footersection {
background: #333;
padding: 1rem;
color: #FFFFFF;
text-align: center;
margin: 0 auto;
overflow: hidden;
}
#footer img {
margin-top: 0.5vh;
height: 20px;
width: 20px;
display: inline;
margin-left: auto;
margin-right: 10px;
}
#footer .smicons {
margin-left: auto;
margin-right: auto;
text-align: center;
}
<!-- Footer Section -->
<footer>
<section id="footer" class="footersection">
<div class="container">
<div class="smicons">
<a href="https://www.facebook.com/centro.llc">
<img src="https://www2.centro.net/l/75412/2019-01-
16/4kzrcg/75412/179517/facebook.png" alt="Centro Facebook">
</a>
<a href="https://twitter.com/centro">
<img src="https://www2.centro.net/l/75412/2019-01-
16/4kzrcb/75412/179519/twitter.png" alt="Centro Twitter">
</a>
<a href="https://www.linkedin.com/company/centro">
<img src="https://www2.centro.net/l/75412/2019-01-
16/4kzrcd/75412/179515/linkedin.png" alt="Centro LinkedIn">
</a>
<a href="https://www.youtube.com/user/centrollc">
<img src="https://www2.centro.net/l/75412/2019-01-
16/4kzrcj/75412/179521/youtube.png" alt="Centro YouTube">
</a>
</div>
</div>
</footer>
3)
<!-- Featured Speakers Section -->
<section id="featuredspeakers" class="featuredspeakerssection">
<div class="container">
<div class="featspeak">
<h3 pardot-region="speakerORspeakers" pardot-region-
type="simple">Featured Speaker
</h3>
</div>
<div>
<hr>
</div>
<img src="https://www2.centro.net/l/75412/2019-01-
15/4kzjqj/75412/179433/ryanmancheecirclegoldring.png" alt="Ryan Manchee">
<h4 pardot-region="speaker name" pardot-region-type="simple">[SPEAKER
NAME]
</h4>
<h5 pardot-region="speaker title" pardot-region-type="simple">Speaker
Title
</h5>
<p class="lead" pardot-region="speaker bio1" pardot-region-
type="simple">Speaker Bio 1</p>
<p class="lead" pardot-region="speaker bio2" pardot-region-
type="simple">Speaker Bio 2</p>
</div>
/* Feature Speaker Section */
.featuredspeakerssection {
padding: 1rem 0;
}
#featuredspeakers .container {
margin: 0;
margin-top: 1vh;
margin-left: 0vw;
}
#featuredspeakers h3 {
font-size: 1.5rem;
color: #1fadde;
text-align: left;
margin-left: 7vw;
margin-top: 7vh;
}
#featuredspeakers hr {
display: inline-block;
margin: -50px 50px 75px 20px;
overflow: hidden;
border-style: inset;
border-width: 0.5px;
border-color: #ffbf3d;
width: 80%;
margin-left: 24vw;
margin-right: auto;
margin-bottom: 3vh;
position: relative;
}
4)
/* Buttons */
.button {
background-color: #FFBF3D;
border: none;
color: #3a3d40;
padding: 10px 25px;
text-align: center;
text-decoration: none;
display: block;
width: 8%;
font-size: 14px;
margin-left: auto;
margin-right: auto;
margin-top: -2vh;
border-radius: 5px;
}
<!-- Banner Section -->
<section id="banner" class="bannersection">
<div class="container">
<h3 pardot-region="banner title" pardot-region-type="simple">Catch Up
With Your Industry</h3>
<p class="lead" pardot-region="banner blurb" pardot-region-
type="simple">Level up and review our most popular past webinars.</p>
</div>
<div pardot-region="banner CTA" pardot-region-type="simple"
href="https://www.centro.net/webinar" class="button">Take Me There
</div>
</section>
1) Your showcase banner image is white on the left, so is displaying correctly.
2) You have issues with the opening and closing of section and div tags
3) Just played around with your margins. The current solution will always give varied results on different sized screens because of the fixed size of the speaker's photo. I would look at finding a different solution for the positioning of your yellow hr
4) Changed this div to an anchor because you need it to act like a button.
/* Showcase */
#showcase {
margin: 0;
padding: 0;
padding-bottom: 20px;
background: url('https://www2.centro.net/l/75412/2019-01-15/4kzjql/75412/179431/herotallerwider.png') no-repeat center/cover;
width: 100%;
position: relative;
overflow-y: hidden;
}
#showcase .container {
margin-top: 13vh;
margin-left: 0vw;
margin-right: 43vw;
}
#showcase h1 {
margin-left: 7vw;
font-size: 1.5rem;
margin-bottom: -0.1em;
color: #1fadde;
}
#showcase h3 {
margin-left: 7vw;
font-size: 0.9rem;
margin-bottom: -1.3em;
color: #3a3d40;
}
#showcase h2 {
margin-left: 7vw;
font-size: 1.2rem;
margin-bottom: -0.5em;
color: #1fadde;
}
#showcase p {
margin-left: 7vw;
font-size: 14px;
margin-bottom: -0.5em;
color: #3a3d40;
width: 70%;
}
/* Footer */
footer .footersection {
background: #333;
padding: 1rem;
color: #FFFFFF;
text-align: center;
margin: 0 auto;
overflow: hidden;
}
#footer img {
margin-top: 0.5vh;
height: 20px;
width: 20px;
display: inline;
margin-left: auto;
margin-right: 10px;
}
#footer .smicons {
margin-left: auto;
margin-right: auto;
text-align: center;
}
/* Feature Speaker Section */
.featuredspeakerssection {
padding: 1rem 0;
}
#featuredspeakers .container {
margin: 0;
margin-top: 1vh;
margin-left: 0vw;
}
#featuredspeakers h3 {
font-size: 1.5rem;
color: #1fadde;
text-align: left;
margin-left: 7vw;
margin-top: 7vh;
}
#featuredspeakers hr {
display: inline-block;
overflow: hidden;
border-style: inset;
border-width: 0.5px;
border-color: #ffbf3d;
margin-left: 40%;
width: 60%;
position: relative;
top: -40px;
}
/* Buttons */
.button {
background-color: #FFBF3D;
border: none;
color: #3a3d40;
padding: 10px 25px;
text-align: center;
text-decoration: none;
display: block;
width: 8%;
font-size: 14px;
margin-left: auto;
margin-right: auto;
margin-top: -2vh;
border-radius: 5px;
}
1)
<!-- Showcase Section-->
<div id="showcase">
<header>
<nav class="cf">
<ul class="cf">
<li class="hide-on-small">
<img src="https://www2.centro.net/l/75412/2019-01-15/4kzjqb/75412/179423/Centro_Webinar_logo.png" alt="Centro Webinars">
</li>
</ul>
Centro Webinars
</nav>
</header>
</div>
2)
<!-- Footer Section -->
<footer>
<section id="footer" class="footersection">
<div class="container">
<div class="smicons">
<img src="https://www2.centro.net/l/75412/2019-01-16/4kzrcg/75412/179517/facebook.png" alt="Centro Facebook">
<a href="https://twitter.com/centro"><img src="https://www2.centro.net/l/75412/2019-01-16/4kzrcb/75412/179519/twitter.png" alt="Centro Twitter">
</a>
<img src="https://www2.centro.net/l/75412/2019-01-16/4kzrcd/75412/179515/linkedin.png" alt="Centro LinkedIn">
<img src="https://www2.centro.net/l/75412/2019-01-16/4kzrcj/75412/179521/youtube.png" alt="Centro YouTube">
</div>
</div>
</section>
</footer>
3)
<!-- Featured Speakers Section -->
<section id="featuredspeakers" class="featuredspeakerssection">
<div class="container">
<div class="featspeak">
<h3 pardot-region="speakerORspeakers" pardot-region-type="simple">Featured Speaker </h3>
</div>
</div>
<hr>
<div>
<img src="https://www2.centro.net/l/75412/2019-01-15/4kzjqj/75412/179433/ryanmancheecirclegoldring.png" alt="Ryan Manchee">
<h4 pardot-region="speaker name" pardot-region-type="simple">[SPEAKER NAME] </h4>
<h5 pardot-region="speaker title" pardot-region-type="simple">Speaker Title </h5>
<p class="lead" pardot-region="speaker bio1" pardot-region-type="simple">
Speaker Bio 1
</p>
<p class="lead" pardot-region="speaker bio2" pardot-region-type="simple">
Speaker Bio 2
</p>
</div>
</section>
4)
<!-- Banner Section -->
<section id="banner" class="bannersection">
<div class="container">
<h3 pardot-region="banner title" pardot-region-type="simple">Catch Up With Your Industry</h3>
<p class="lead" pardot-region="banner blurb" pardot-region-type="simple">
Level up and review our most popular past webinars.
</p>
</div>
<a pardot-region="banner CTA" pardot-region-type="simple" href="https://www.centro.net/webinar" target="_blank" class="button">
Take Me There
</a>
</section>
Related
So I have looked everywhere on stack overflow and counldn't find someone with a similar issue. I have two classes in the main body with a few different images in the divs. I am planning on switching through them with a slideshow using Jquery. The problem is that the h1 element which is "Boba Fusion" is inline in the first class but is on top of eachother in the second class so that boba is on one line and fusion is on another line. I have linked my HTML and CSS.
What is causing the H1 to behave differently?
#import url('https://fonts.googleapis.com/css2?family=Montserrat:wght#800&display=swap');
* {
margin: 0px;
padding: 0px;
font-family: 'Montserrat', sans-serif;
}
/* CSS stylings for nav */
a {
text-decoration: none;
color: inherit;
}
.container {
display: flex;
width: 100%;
}
nav ul {
margin-top: 0px;
background-color: #4B4B4B;
margin-left: 0px;
clip-path: polygon(1% 0, 100% 2%, 1000% 10000%);
}
nav ul li {
display: inline-block;
list-style: none;
padding-left: 100px;
font-size: 15px;
color: white;
margin-top: 0px;
padding-bottom: 33px;
flex: 2 0 0;
}
nav ul li:first-child {
padding-left: 90px;
margin-left: 0px;
}
nav ul li:nth-child(6) {
padding-top: 20px;
padding-right: 30px;
margin-right: 0;
}
#bobaimg {
padding-left: 25px;
padding-top: 10px;
margin: 0;
display: block;
flex: 1 0 0;
}
/* CSS styling for main content*/
.main-page {
display: none;
margin-top: 0px;
text-align: center;
min-height: calc(100vh - 40px);
background-size: 1300px 700px;
color: white
}
.main-page-2 {
/* display: none; */
margin-top: 0px;
text-align: center;
min-height: calc(100vh - 40px);
background-size: 1300px 700px;
color: white
}
#specials-head {
padding-top: 50px;
}
.fusion-head {
padding-top: 120px;
float: left;
position: absolute;
padding-left: 30px;
transform: scale(1.2);
}
#fusion-title {
float: left;
position: absolute;
padding-left: 110px;
transform: scale(1.4);
}
#about-img {
transform: scale(0.8);
margin-top: 40px;
float: left;
}
#why-choose {
transform: scale(12);
margin-top: 200px;
position: absolute;
float: left;
padding: 0;
margin-left: 200px;
left: 0;
width: 120%;
}
#quality {
transform: scale(0.8);
margin-left: 470px;
margin-top: 250px;
}
#flavour-btn {
margin-bottom: 70px;
margin-top: 280px;
margin-left: 800px;
color: gray;
background-color: white;
border: none;
transform: scale(1.7);
padding: 10px;
font-size: 10px;
font-weight: lighter;
/* display: none; */
}
#flavour-btn:hover {
cursor: pointer;
transform: scale(1.8);
}
#slideshow {
padding-top: 100px;
padding-bottom: 50px;
}
.dot {
cursor: pointer;
height: 15px;
width: 15px;
margin: 0 2px;
background-color: white;
border-radius: 10%;
display: inline-block;
transition: background-color 0.6s ease;
transform: scale(1.2);
}
.active,
.dot:hover {
background-color: #717171;
}
/* CSS styling for footer*/
.footer {
margin-top: 10px;
margin-bottom: 0px;
}
.footer1-ul li {
display: inline-block;
list-style: none;
padding-right: 10px;
transform: scale(0.65);
padding-bottom: 0px;
margin-bottom: 0;
padding-top: 0px;
color: gray;
}
.footer1-ul {
padding-top: 0px;
padding-bottom: 0;
float: left;
}
.footer2-ul {
float: right;
margin: 0;
padding: 0;
}
.footer2-ul li {
display: inline-block;
margin-left: 0px;
list-style: none;
padding-right: 10px;
transform: scale(0.65);
padding-bottom: 0px;
color: gray;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="about.css">
<title>Boba Fusion</title>
</head>
<body class='main'>
<!-- top nav bar and logo -->
<div class="container">
<div id="bobaimg">
<img src="/images/Boba Fusion logo (1).svg" alt="picture of bubble tea" width="150px">
</div>
<div id="nav">
<nav class='main-nav'>
<ul class="nav-ul">
<li>
Home +
</li>
<li>
Menu +
</li>
<li>
Specials +
</li>
<li>
About Us +
</li>
<li>
Win Prizes +
</li>
<li>
<img src="/images/cart-shopping-solid.svg" width="30px">
</li>
</ul>
</nav>
</div>
</div>
<!-- Main content -->
<div class="main-page" style="background-image: url(/images/aboutUs-back.png);">
<div id="specials-head">
<img src="/images/aboutus.png">
</div>
<div class="fusion-head">
<h1 id="fusion-title">
Boba Fusion
</h1>
<img src="/images/textbox-about.png" id="about-img">
</div>
<div>
<button type="button" id="flavour-btn">Our Flavours</button>
</div>
<div style="text-align:center" id="slideshow">
<span class="dot" onclick="currentSlide1()"></span>
<span class="dot" onclick="currentSlide2()"></span>
</div>
</div>
<div class="main-page-2" style="background-image: url(/images/aboutUs-back.png);">
<div id="specials-head">
<img src="/images/aboutus.png">
</div>
<div class="fusion-head">
<h1 id="fusion-title">
Boba Fusion
</h1>
</div>
<div class="fusion-head">
<img src="/images/why choose.png" id="why-choose">
</div>
<div>
<img src="/images/quality.png" id="quality">
</div>
<div style="text-align:center" id="slideshow">
<span class="dot" onclick="currentSlide1()"></span>
<span class="dot" onclick="currentSlide2()"></span>
</div>
</div>
<!-- footer -->
<footer class="footer">
<ul class="footer1-ul">
<li>
<img src="/images/location-dot-solid.svg" alt="location icon" width="15px"> 123 Name Street, Toronto, ON, M6E 1T9
</li>
<li>
<img src="/images/phone-solid.svg" alt="phone icon" width="15px"> (+1) 416 456 789
</li>
<li>
<img src="/images/envelope-solid.svg" alt="email icon" width="15px"> boba#fusion.com
</li>
</ul>
<ul class="footer2-ul">
<li>
<img src="/images/facebook-brands.svg" alt="location icon" width="15px">
</li>
<li>
<img src="/images/twitter-brands.svg" alt="phone icon" width="15px">
</li>
<li>
<img src="/images/youtube-brands.svg" alt="email icon" width="15px">
</li>
<li>
<img src="/images/linkedin-brands.svg" alt="email icon" width="15px">
</li>
</ul>
</footer>
<script src="about.js"></script>
</body>
</html>
You are using "transform: scale(1.2);" for the class ".fusion-head"
so it scales your h1 once (because the h1 is inside it).
Then you are using "transform: scale(1.4);" for id "#fusion-title"
so it scales it twice.
One suggestion on your issue. Since you want the h1 element keeps the same style in both div. You can try to have a default CSS style in your file.
h1 {
...
}
I was creating a website and am stuck because I keep resizing the screen and trying to make it mobile friendly. However, there are two sections that I cannot seem to fix. I cannot remember how I got the first three sections to stop moving while I resized the screen. I was wondering if I could get some help.
My website is shivaniahuja.com
If you look at the contact me page and the footer and try to resize them you will see the problem. Please let me know if you can help and I can attach my code if needed.
*{
margin: 0;
padding: 0;
}
#main{
width: 100%;
height: 100vh;
background-image: url(../imgs/Background.jpg);
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
display: flex;
}
img{
width: 15%;
height: 100%;
}
#first-name{
display: inline-block;
font-family: 'Roboto', sans-serif;
font-size: 14px;
color: #2f3338;
padding-left: 2%;
font-size: 2vmin;
}
nav{
width: 100%;
height: 10vh;
background-color: #FFFFFF;
line-height: 80px;
z-index: 1;
position: fixed;
}
nav ul li{
list-style-type: none;
display: inline-block;
}
nav ul{
float: right;
margin-right: 20px;
}
nav ul li a{
text-decoration: none;
font-family: 'Roboto', sans-serif;
font-size: 2vmin;
color: #2f3338;
padding: 20px;
}
nav ul li a:hover{
color: #3377CC;
}
#main p{
position: absolute;
top: -1000px;
text-align: center;
color: white;
font-size: 50px;
font-family: 'Roboto', sans-serif;
font-weight: 700;
}
section{
width: 100%;
text-align: center;
padding-top: 7%;
}
html{
scroll-behavior: smooth;
overflow-x: hidden;
}
section#about-me #p2{
width: 40%;
position: relative;
height: 40%;
float: right;
top: 40%;
margin-top: 3%;
right: 10%;
line-height: 200%;
font-family: 'Libre Franklin', sans-serif;
text-align: justify;
font-size: 2.2vmin;
}
section#about-me{
height: 60vh;
}
section#photography{
height: 110vh;
background-color: #F5F5F5;
}
section#experience{
height: 280vh;
background-color: #F5F5F5;
}
section#contact{
}
#contact-header{
font-size: 2.5vmin;
top: 20%;
}
section#about-me #pic{
width: 40%;
height: 40%;
position: absolute;
right: 55%;
margin-top: 2%
}
#contact-div{
position: relative;
top: 50%;
}
section#blog{
width: 100%;
padding-top: 8.5%;
}
.navs::before,
.navs::after {
display: inline-block;
content: "";
border-top: 2px solid black;
width: 5%;
margin: 0 1rem;
transform: translateY(-0.5rem);
}
h2{
position: relative;
top: -200;
}
#title{
position: absolute;
top: 50%;
font-size: 10vmin;
color: white;
left: 35%;
}
span{
position: absolute;
top: 60%;
font-size: 300%;
color: white;
left: 35%;
display: inline-block;
}
span:before{
content: 'HTML';
animation: animate infinite 8s;
position: relative;
left: 50%;
font-size: 6vmin;
}
#keyframes animate{
0%{
content: 'ENGINEER';
}
25%{
content: 'ENGINEER';
}
50%{
content: 'DEVELOPER';
}
75%{
content: 'DEVELOPER';
}
100%{
content: 'ANALYST';
}
}
.pic-and-text{
width: 18%;
height: 22%;
border-radius: 15%
}
section#experience #pic01{
left: -20%;
margin-top: 2%;
margin-bottom: 5%;
position: relative;
}
section#experience #berkeley-name{
position: relative;
font-size: 3vmin;
left: 5%;
top: 0%;
color: #3377CC;
font-family: 'Roboto', sans-serif;
}
section#experience #berkeley-major{
position: relative;
font-size: 16px;
bottom: 200px;
left: 78px;
color: #5E9515;
font-weight: bold;
font-family: 'Roboto', sans-serif;
}
section#experience #berkeley-location{
position: relative;
font-size: 16px;
bottom: 195px;
right: 65px;
font-weight: bold;
font-family: 'Roboto', sans-serif;
}
section#experience #berkeley-description{
position: relative;
bottom: 180px;
height: 40px;
width: 600px;
right: -610px;
font-family: 'Libre Franklin', sans-serif;
line-height: 30px;
font-size: 2vmin;
}
section#blog #full-blog{
position: relative;
top: -40px;
}
section#blog .blog-description{
font-size: 20px;
font-family: 'Libre Franklin', sans-serif;
line-height: 30px;
}
#pic001{
width: 17.5%;
}
#pic002{
width: 17.5%;
}
#pic003{
width: 17.5%;
}
.header{
font-size: 3.5vmin;
}
.blog-pics{
margin-left: .5%;
margin-top: 1%
}
section#blog #blog-description01{
margin-top: 15px;
}
#photography-paragraph{
font-size: 2.5vmin;
font-family: 'Libre Franklin', sans-serif;
margin-bottom: 2vh;
margin-top: 2vh;
}
.polaroid {
cursor:pointer;
margin:10px;
border: 1px solid #cccccc78;
background-color: #ffffff;
padding: 7%;
box-shadow: 4px 6px 4px #00000012;
text-align: center;
font-family: 'Caveat','Arial', sans-serif;
}
.polaroid .square {
background:black;
}
.polaroid .picture {
width:100%;
padding-top: 100%;
background-position: center;
background-size:cover;
opacity:0;
}
.polaroid.developed .square {
animation: flash 1.5s;
background:black;
}
.polaroid.developed .picture {
animation: fade-in 3s;
opacity:1;
}
.polaroid .labelName {
text-align: center;
font-size: 24px;
line-height:26px;
}
.polaroid-gallery {
display:-ms-grid;
display:grid;
-ms-grid-columns: 25% 25% 25% 25%;
grid-template-columns: 23% 23% 23% 23%;
margin-left: 5%
}
/* Adjust CSS Grid for Microsoft Edge */
.polaroid:nth-child(1) {
-ms-grid-row: 1;
-ms-grid-column:1;
}
.polaroid:nth-child(2) {
-ms-grid-row: 1;
-ms-grid-column:2;
}
.polaroid:nth-child(3) {
-ms-grid-row: 1;
-ms-grid-column:3;
}
.polaroid:nth-child(4) {
-ms-grid-row: 1;
-ms-grid-column:4;
}
.polaroid:nth-child(5) {
-ms-grid-row: 2;
-ms-grid-column:1;
}
#keyframes fade-in {
0% { opacity: 0; }
100% { opacity: 1; }
}
#keyframes flash {
2% {
background:black;
opacity: 0.5;
}
5% {
background:white;
opacity:1;
}
50% {
background:white;
opacity:.5
}
}
#footer{
background-color: #000000;
width: 100%;
padding-top: 2vh;
color: white;
padding-left: 1%;
}
#footer-paragraph{
position: relative;
top: 60%;
}
#import url('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
a, a:hover {
text-decoration: none;
}
.socialbtns, .socialbtns ul, .socialbtns li {
margin: 0;
padding: 5px;
}
.socialbtns li {
list-style: none outside none;
display: inline-block;
}
.socialbtns .fa {
width: 40px;
height: 28px;
color: #000;
background-color: #FFF;
border: 1px solid #000;
padding-top: 12px;
border-radius: 22px;
-moz-border-radius: 22px;
-webkit-border-radius: 22px;
-o-border-radius: 22px;
}
.socialbtns .fa:hover {
color: #FFF;
background-color: #000;
border: 1px solid #000;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght#300&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght#100&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght#600&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght#300&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:wght#200&display=swap" rel="stylesheet">
<link rel="stylesheet" href ="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<h1 id="title"> SHIVANI AHUJA</h1>
<span></span>
<body>
<div class ="container">
<div id="main">
<nav>
<div id= "first-name"> SHIVANI AHUJA </div>
<ul>
<li> ABOUT ME </li>
<li> EXPERIENCE</li>
<li> BLOG POSTS</li>
<li> PHOTOGRAPHY</li>
<li> CONTACT </li>
</ul>
</nav>
</div>
<section id="about-me">
<h1 class="navs" class="header"> ABOUT ME</h1>
<img src="assets/imgs/paris-2017-home.jpeg" id="pic">
<div id="p2div">
<p id="p2"> Hey! My name is Shivani and I am an undergraduate student at UC Berkeley studying Computer Science. I'm super passionate about Artificial Intelligence and Natural Language Processing. Haha, I sound like a nerd right now, but I really love what I do! I've spent tons of hours curating images and watching HTML and CSS tutorials on Youtube to finally create this masterpiece that lies in front of you. The process of creating this website was fun, yet undeniably frustrating. After creating my first website from scratch, I plan to create many more and teach others how to recreate this process!</p>
</div>
</section>
<section id="experience">
<h1 class="navs"> HERE'S WHAT I'VE DONE SO FAR</h1>
<div class= "experience-squares" id="experience-square">
<img src="assets/imgs/coming.png" class="pic-and-text" id="pic01">
<p id="berkeley-name"> Creator and iOS Developer, Summer 2020</p>
<p id="berkeley-major"> IBS Application </p>
<p id="berkeley-location"> Hayward, CA</p>
<p id="berkeley-description"> Currently,</p>
</div>
</div>
</section>
<section id="blog">
<div id=full-blog>
<h1 class="navs" class="header">BLOG</h1>
<p class="blog-description" id= "blog-description01"> I write about women in tech, hiking, and some of my personal experiences.</p>
<p class="blog-description" id= "blog-description02"> Here are three of my recent posts:</p>
<div id="pictures">
<img src="assets/imgs/paris-2017-home.jpeg" id="pic001" class="blog-pics">
<img src="assets/imgs/paris-2017-home.jpeg" id="pic002" class="blog-pics">
<img src="assets/imgs/paris-2017-home.jpeg" id="pic003" class="blog-pics">
</div>
</div>
</section>
<section id="photography">
<h1 class="navs" class="header">PHOTOGRAPHY</h1>
<p id="photography-paragraph"> Creating memorabilia is an art. An art that has allowed me to capture the emotions, smiles, and happiness of every individual depcited in this gallery.</p>
<div class="polaroid-gallery">
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/sunflower.JPG')"></div>
</div>
<div class="labelName">SunFlowers</div>
<div class="labelText">Berkeley, CA</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/pic-with-mom.png')"></div>
</div>
<div class="labelName">Mommy's Girl</div>
<div class="labelText">Ludhiana, PB</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/sailboat.jpg')"></div>
</div>
<div class="labelName">Sailboat</div>
<div class="labelText">Santa Cruz, CA</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/glasses-aesthetic.JPG')"></div>
</div>
<div class="labelName">Foolin' Around</div>
<div class="labelText">Berkeley, CA</div>
</div>
</div>
<link href="https://fonts.googleapis.com/css?family=Caveat" rel="stylesheet">
<div class="polaroid-gallery">
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/flowers.jpg')"></div>
</div>
<div class="labelName">Orchid Bush</div>
<div class="labelText">Hayward, CA</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/graduation.jpg')"></div>
</div>
<div class="labelName"> Besties 4 Life!</div>
<div class="labelText">Hayward, CA</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/background.jpg')"></div>
</div>
<div class="labelName">Pink Sky</div>
<div class="labelText">Lake Tahoe, CA</div>
</div>
<div class="polaroid" onmouseover="this.classList.add('developed')">
<div class="square">
<div class="picture" style="background-image: url('assets/imgs/cousins.PNG')"></div>
</div>
<div class="labelName">Three Idiots</div>
<div class="labelText">Ludhiana, PB</div>
</div>
<link href="https://fonts.googleapis.com/css?family=Caveat" rel="stylesheet">
</section>
<div id="wrap">
<section id="contact">
<h1 class="navs" class="contact-header">CONTACT</h1>
<p id="contact-paragraph">If you have any inquiries or questions, please feel free to contact me on these social media
sites. I look forward to hearing from you! </p>
<br/>
<div align="center" class="socialbtns">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</section>
<section id="footer">
<p id="footer-paragraph"> Copyright #2020 Shivani Ahuja. All Rights Reserved.
</section>
</div>
</body>
</html>
I found one inconsistency were you wrapped up your div tag...
This often leads to buggy layouts just for not closing tags properly.
<div id="wrap">
<section id="contact">
<!-- your HTML code -->
<div align="center" class="socialbtns">
<!-- your HTML code -->
</div>
</div><!-- REMOVE THIS! did you want to finish div#wrap here ? -->
</section>
<section id="footer">
<p id="footer-paragraph"> Copyright #2020 Shivani Ahuja. All Rights Reserved.
</section>
</div><!-- or did you want to finish div#wrap here ? -->
To make the whole site responsive put a <meta> tag like the one below before and after the <body> tags.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Next, set out your HTML like this:
<div id="wrap">
<section id="contact">
<!-- Code here -->
<div align="center" class="socialbtns">
<!-- Your Code Here -->
</div>
</section>
<section id="footer">
<p id="footer-paragraph"> Copyright #2020 Shivani Ahuja. All Rights Reserved.
</section>
</div>
And of course use the <meta> tags I mentioned
Add position relative to .polaroid-gallery
.polaroid-gallery {
display: -ms-grid;
display: grid;
-ms-grid-columns: 25% 25% 25% 25%;
grid-template-columns: 40% 40% 40% 36%;
margin-left: 5%;
position: absolute;
}
nav {
width: 100%;
/* height: 10vh; */ i remove this for the menu dont resize to much
background-color: #FFFFFF;
line-height: 80px;
z-index: 1;
position: fixed;
}
section#contact {
margin-bottom: 2vh;
font-size: 2.5vmin;
border: 3px solid red; /* to test */
background: black; /* to test */
}
i recommend you check the structure of your html, and relative sizes to responsive design
Pls see my codepen here: http://codepen.io/Chiz/pen/oLpGOB
It looks fine, until you resize the window and reduce the width of the browser window, and then the first card becomes positioned taller than the rest of the 3 cards! What causes this and how do I fix it?
Tks!
* {
box-sizing: border-box;
}
body {
height: 100vh;
font-family: "Open Sans";
}
.header {
background-color: #1b9ef2;
width: 100%;
height: 20rem;
}
.header h1 {
color: white;
font-size: 1.5rem;
line-height: 15rem;
text-align: center;
}
.CardContainer {
width: 90%;
margin: 0 auto;
text-align: center;
margin-top: -6rem;
}
.Card {
display: inline-block;
width: 20%;
height: 30rem;
margin: 0 1rem 0 1rem;
padding: 0rem;
background-color: rgb(250, 250, 250);
border: 1px solid black;
border-radius: 10px;
position:relative;
}
.Card h2 {
color: #1b9ef2;
font-size: 1.2rem;
font-weight: 600;
padding:2.5rem;
}
.cardimgcontainer
{
position:absolute;
top:50%;
transform:translateY(-50%);
}
.Card img
{
width:80%;
height:40%;
max-height:180px;
text-align:center;
}
.Card .Price
{
position:absolute;
bottom:0;
width:100%;
padding:2.5rem;
line-height:1.5rem;
color:rgb(70,70,70);
}
.Card .Price .bold
{
font-weight:800;
font-size:1.4rem;
}
<div class="header">
<h1>Choose your subscription plan</h1>
</div>
<div class="CardContainer">
<div class="Card">
<h2>2 Days Trial</h2>
<div class="cardimgcontainer">
<img src="https://s-media-cache-ak0.pinimg.com/originals/0d/e6/b3/0de6b34699563781365b286c45359692.jpg" />
</div>
<div class="Price"><span class="bold">$9.99</span><br />1 account</div>
</div>
<div class="Card">
<h2>Personal</h2>
<div class="cardimgcontainer">
<img src="http://static.vecteezy.com/system/resources/previews/000/090/876/original/rolling-hills-landscape-vector.jpg" />
</div>
<div class="Price"><span class="bold">$29.99</span><br />5 accounts</div>
</div>
<div class="Card">
<h2>Advanced</h2>
<div class="cardimgcontainer">
<img src="https://d13yacurqjgara.cloudfront.net/users/968424/screenshots/2287311/2015_10_12_flatlandscape_800x600_v01_1x.jpg" />
</div>
<div class="Price"><span class="bold">$39.99</span><br />10 accounts</div>
</div>
<div class="Card">
<h2>Business</h2>
<div class="cardimgcontainer">
<img src="https://s-media-cache-ak0.pinimg.com/736x/18/fe/3f/18fe3f54a4ae949f7993442a9d8a3447.jpg" />
</div>
<div class="Price"><span class="bold">$49.99</span><br />50 accounts</div>
</div>
</div>
Use vertical-align: top;
.Card {
display: inline-block;
width: 20%;
height: 30rem;
margin: 0 1rem 0 1rem;
padding: 0rem;
background-color: rgb(250, 250, 250);
border: 1px solid black;
border-radius: 10px;
position: relative;
vertical-align: top;
}
One more best solution is you can tile your cards into full width which I have shown in demo. (for responsive mode)
Responsive CSS:
#media only screen and (max-width: 800px) {
/*** You can change the responsive screen size as per your requirement.
.Card {
width: 100%;
margin-bottom: 20px;
}
}
Full Demo:
* {
box-sizing: border-box;
}
body {
height: 100vh;
font-family: "Open Sans";
}
.header {
background-color: #1b9ef2;
width: 100%;
height: 20rem;
}
.header h1 {
color: white;
font-size: 1.5rem;
line-height: 15rem;
text-align: center;
}
.CardContainer {
width: 90%;
margin: 0 auto;
text-align: center;
margin-top: -6rem;
}
.Card {
display: inline-block;
width: 20%;
height: 30rem;
margin: 0 1rem 0 1rem;
padding: 0rem;
background-color: rgb(250, 250, 250);
border: 1px solid black;
border-radius: 10px;
position:relative;
}
.Card h2 {
color: #1b9ef2;
font-size: 1.2rem;
font-weight: 600;
padding:2.5rem;
}
.cardimgcontainer
{
position:absolute;
top:50%;
transform:translateY(-50%);
}
.Card img
{
width:80%;
height:40%;
max-height:180px;
text-align:center;
}
.Card .Price
{
position:absolute;
bottom:0;
width:100%;
padding:2.5rem;
line-height:1.5rem;
color:rgb(70,70,70);
}
.Card .Price .bold
{
font-weight:800;
font-size:1.4rem;
}
#media only screen and (max-width: 800px) {
.Card {
width: 100%;
margin-bottom: 20px;
}
}
<div class="header">
<h1>Choose your subscription plan
</h1>
</div>
<div class="CardContainer">
<div class="Card">
<h2>2 Days Trial
</h2>
<div class="cardimgcontainer">
<img src="https://s-media-cache-ak0.pinimg.com/originals/0d/e6/b3/0de6b34699563781365b286c45359692.jpg" />
</div>
<div class="Price">
<span class="bold">$9.99
</span>
<br />1 account
</div>
</div>
<div class="Card">
<h2>Personal
</h2>
<div class="cardimgcontainer">
<img src="http://static.vecteezy.com/system/resources/previews/000/090/876/original/rolling-hills-landscape-vector.jpg" />
</div>
<div class="Price">
<span class="bold">$29.99
</span>
<br />5 accounts
</div>
</div>
<div class="Card">
<h2>Advanced
</h2>
<div class="cardimgcontainer">
<img src="https://d13yacurqjgara.cloudfront.net/users/968424/screenshots/2287311/2015_10_12_flatlandscape_800x600_v01_1x.jpg" />
</div>
<div class="Price">
<span class="bold">$39.99
</span>
<br />10 accounts
</div>
</div>
<div class="Card">
<h2>Business
</h2>
<div class="cardimgcontainer">
<img src="https://s-media-cache-ak0.pinimg.com/736x/18/fe/3f/18fe3f54a4ae949f7993442a9d8a3447.jpg" />
</div>
<div class="Price">
<span class="bold">$49.99
</span>
<br />50 accounts
</div>
</div>
</div>
just add vertical-align: top; for the Card class.
Your layout is looking good in big screen That's why you need to write this code only for small devices so You can try the below code.
#media (max-width: 768px){
.CardContainer .Card{
float: left;
}
}
You need to add vertical-align:top; to .Card.
Because you have used display:inline-block So, by default it is vertical-align:baseline;
And it will align the baseline of the element with the baseline of the parent element.
Your updated Codepen
.Card {
display: inline-block;
width: 20%;
height: 30rem;
margin: 0 1rem 0 1rem;
padding: 0rem;
background-color: rgb(250, 250, 250);
border: 1px solid black;
border-radius: 10px;
position:relative;
vertical-align:top;
}
I think this will do the job:
.CardContainer .card {vertical-align:top;}
I am new to CSS and it's not clear to me why the header and menu links stay within the container but not the other elements. I can fix this by including margins for the other elements but I would like to understand why this is happening.
Is there a way to keep elements within the container without specifying margins for each element or (div). See JS fiddle code and code below, for example. I would like to keep the #main content within #container.
JSFiddle link: http://jsfiddle.net/6qt8ry1L/
body {
background-color: #F7F7F0;
}
#container {
width: 1000px;
position: relative;
margin: 0 auto;
text-align: center;
background-color: #8e8e20;
}
header {
background-image: url("header.jpg");
background-repeat: no-repeat;
height: 224;
}
h1 {
color: #ffffff;
padding: 10px;
text-align: left;
}
#nav ul {
list-style: none;
background-color: black;
height: 40px;
margin-top: 0;
color: white;
}
#nav li {
display: inline-block;
padding-top: 10px;
padding-left: 50px;
padding-right: 50px;
padding-bottom: 10px;
}
#MainContent {
margin-top: 10px;
padding-top: 20px;
border-top: 1px solid #545454;
background-color: #b6c5a3;
height: 200;
color: #492b40;
font: 11px/12px Verdana, Arial, Helvetica, sans-serif;
}
#col1 {
width: 20%;
height: 30%;
margin-top: 15px;
float: left;
background-color: lightgray;
}
#col2 {
float: left;
margin-left: 1%;
margin-top: 15px;
height: 30%;
width: 20%;
background-color: lightgray;
}
#col3 {
float: left;
margin-top: 15px;
width: 20%;
height: 30%;
margin-left: 1%;
background-color: lightgray;
}
#Content:after {
content: '';
display: block;
clear: both;
}
#footer {
float: left;
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #545454;
background-color: #b6c5a3;
height: 60;
width: 950px;
color: #492b40;
font: 11px/12px Verdana, Arial, Helvetica, sans-serif;
}
<html>
<head>
<link rel="stylesheet" href="Style.css">
</head>
<body>
<div id="container">
<header>
<div id="heading">
<h1> Hello there !!! </h1>
</div>
</header>
<div id="nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
<li>Links</li>
</ul>
</div>
</div>
<div id="MainContent">
Main Content
</div>
<div id="Content">
<div id="col1">
Col1
</div>
<div id="col2">
col2
</div>
<div id="col3">
col 3
</div>
</div>
<div id="footer">
<p>Copyright 2004 xyz Association</p>
<p>All rights reserved etc etc..</p>
</div>
</div>
<!--end container-->
</body>
</html>
Your container is closed just after closing div#nav.
Put that closing div at the end and your problem'd be fixed.
I noticed you have more closing tags than you have opening DIVs. As a habit when ever you create a <DIV> be sure to insert </DIV> immediately. To keep track of the opening and closing DIVs. I am guessing this mismatch closing DIVs is likely the cause of your problem.
I have a fixed header with height 200px.
How to make anchor links in Fixed header.
Now the menu is not work good.
You can see my code below:
.fluid {
clear: both;
margin-left: 0;
width: 100%;
float: left;
display: block;
}
/* Mobile Layout: 480px and below. */
body {
background-color: #EEEEEE;
font-family: "Open Sans", Helvetica, "Heiti TC", "Microsoft JhengHei", "Microsoft Yahei", "PMingLiU", sans-serif;
font-size: 100%;
margin-top: 0px;
}
.gridContainer {
margin-left: auto;
margin-right: auto;
padding-left: 1.1375%;
padding-right: 1.1375%;
clear: none;
float: none;
width: auto;
}
#header {
margin-top: 0;
margin-right: auto;
margin-left: auto;
display: block;
width: 100%;
height: 200px;
max-width: 1000px;
position: fixed;
background-color: #FF6600;
}
/* header - navigation */
#subnav {
height: 100%;
margin-right: auto;
width: 100%;
background-color: #1BBC9B;
font-size: 120%;
}
#navmenu ul {
padding: 0;
margin-top: 4px;
margin-right: auto;
margin-left: 0%;
margin-bottom: 0;
width: 650px;
}
#navmenu li {
display: inline;
float: left;
}
#navmenu a {
color: #294C52;
display: inline-block;
padding: 10px 20px;
text-align: center;
text-decoration: none;
font-weight: bold;
}
#navmenu li a {
border-right: 1px solid #294C52;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
#navmenu li:last-child a {
border-right: 1px solid #576979;
/* no border on last list item */
}
#navmenu li:first-child a {
background-color: #294C52;
color: #FFFFFF;
}
#navmenu a:hover,
nav a:active {
background-color: #1BBC9B;
color: #FFFFFF;
}
#content {
width: 100%;
max-width: 1000px;
height: 100%;
margin-top: 1px;
}
#section1 {
background-color: #294C52;
width: 100%;
display: block;
padding-top: 5px;
padding-bottom: 5px;
margin-top: 198px;
}
#section2 {
background-color: #EEEEEE;
}
#section3 {
background-color: #EEEEEE;
}
#section4 {
background-color: #EEEEEE;
margin-left: 0;
width: 100%;
float: left;
}
#content-about-org-left {
width: 48.1012%;
background-color: #FFFFFF;
float: left;
clear: none;
}
#content-about-org-centre {
width: 48.1012%;
margin-left: 1.2658%;
clear: none;
background-color: #FFFFFF;
float: right;
}
#content-about-org-right {
background-color: #FFFFFF;
}
#section5 {
background-color: #EEEEEE;
}
/* content - typography */
.content-list {
list-style-type: none;
color: #294C52;
text-indent: -25px;
font-size: 100%;
line-height: 173%;
}
.content-list-bold {
font-weight: bolder;
font-size: 110%;
color: #294C52;
}
.content-title {
background-color: #903233;
color: #FFFFFF;
padding-top: 3px;
}
.content-p-white {
color: #FFFFFF;
padding-left: 10px;
padding-right: 10px;
text-align: justify;
line-height: 25px;
padding-top: 0px;
padding-bottom: 0px;
}
.content-p-black {
color: #294C52;
padding-left: 10px;
padding-right: 10px;
text-align: justify;
line-height: 25px;
font-size: 100%;
}
.content-p-black-b {
color: #294C52;
font-weight: bolder;
padding-left: 10px;
font-size: 110%;
}
<div class="gridContainer clearfix">
<header id="header">
<nav id="subnav" class="fluid">
<ul id="navmenu">
<li>成立背景
</li>
<li>協會使命
</li>
<li>營運模式
</li>
<li>協會組織
</li>
<li>活動及刊物
</li>
</ul>
</nav>
</header>
<!--end of header-->
<!--start of content-->
<div class="fluid" id="content">
<div id="section1" class="fluid ">
<p class="content-p-white">《2013年香港殘疾人士貧窮情況報告》顯示介乎18至64歲適齡工作的殘疾人士的貧窮率為22.4%,遠較相同年齡群的整體貧窮率10.5%為高。再者,按經濟活動身分劃分,近18萬名的殘疾適齡工作人士當中,只有39.1%有從事經濟活動,遠低於整體人口中同年齡層的72.8%。</p>
<p class="content-p-white">於2013年3月初,一群熱心人士包括郭鍵勳博士、謝俊謙教授及伍杏修先生等有意建立一個各方協作平台,改善殘疾人士的就業困難。</p>
<p class="content-p-white">資訊科技易達協會有限公司 Accessible IT Development Association Limited (AIDA) 於2014年11月正式註冊成立。</p>
<!--<div id="secttion1-bg"></div>-->
</div>
<!--end of section1-->
<div id="section2" class="fluid">
<article>
<h2 class="content-title"> 協會使命</h2>
<p class="content-p-black">資訊科技易達協會是一個社會企業致力提供專業資訊科技服務,同時為嚴重殘疾人士提供培訓及工作機會,讓學員可選擇在家居從事資訊科技相關工作;協會全力推動無障礙軟件開發,協助社會資訊共融。</p>
</article>
</div>
<!--end of section2-->
<div id="section3" class="fluid">
<article>
<h2 class="content-title"> 營運模式</h2>
<figure>
<img src="images/2-about-us_03.jpg" alt="營運模式示意圖" class="alignRight" title="營運模式示意圖" />
</figure>
<p class="content-p-black">全面利用現代通訊科技的便利,解決殘疾人士面對指定工作地點的限制,讓他們可選擇在家居或院舍工作,同時得到必要的護理。AIDA選擇網頁開發作為起步點,由「無障礙學堂」(Barrier-Free School) 及業界專業義工負責培訓學員,讓他們掌握指定技術。</p>
<p class="content-p-black">AIDA會承接工作項目,將項目分拆,然後將組件分配給技術程度不同的學員,並會密切督導整個項目的進行。AIDA已經與本地多間知名網頁開發公司結為合作伙伴,致力確保AIDA的所有服務均符合市場要求。AIDA會以殘疾友善機構的工作項目作為開始,當累積一定成功往績後,會推廣至主流市場。</p>
</article>
</div>
<!--end of section3-->
<div id="section4" class="fluid">
<article>
<h2 class="content-title"> 協會組織</h2>
<div id="content-about-org-left" class="fluid">
<ul class="content-list">
<li class="content-list-bold">名譽贊助人</li>
<li>謝俊謙教授</li>
<li class="content-list-bold">主席</li>
<li>郭鍵勳博士</li>
<li class="content-list-bold">副主席</li>
<li>劉海軍先生</li>
<li class="content-list-bold">義務秘書</li>
<li>伍杏修先生</li>
<li class="content-list-bold">義務司庫</li>
<li>郭皓君女士</li>
<li class="content-list-bold">核數師</li>
<li></li>
<li class="content-list-bold">義務法律顧問</li>
<li>林子絪女士</li>
<li class="content-list-bold">義務總幹事</li>
<li>蘇炳坤先生</li>
<li class="content-list-bold">諮詢委員及指導</li>
<li></li>
</ul>
</div>
<div id="content-about-org-centre" class="fluid">
<ul class="content-list">
<li class="content-list-bold">董事</li>
<li>張健輝先生</li>
<li>郭鍵勳博士</li>
<li>郭皓君女士</li>
<li>劉海軍先生</li>
<li>羅偉祥先生</li>
<li>伍杏修先生</li>
<li>吳家榮博士</li>
<li>蘇炳坤先生</li>
<li>謝俊謙教授</li>
<li>黃婉冰女士</li>
<li>游寶榮先生</li>
</ul>
</div>
<div id="content-about-org-right" class="fluid">
<ul class="content-list">
<li class="content-list-bold">工作團隊</li>
<li>王乃東 王迪清 江啟暉 利詠然 李俊輝</li>
<li>李豪飛 冼永健 何浚彥 施嶸傑 翁文菁</li>
<li>茹文祥 郭寧 章世恒 曾志豪 曾鈴茵</li>
<li>黃新陽 蔡冀逵 鄭建慧 盧兆豐</li>
</ul>
<p>
<img src="images/2-about-us_06.jpg" alt="工作團隊成員相片" title="工作團隊成員相片" />
</p>
</div>
</article>
</div>
<!--end of section4-->
<div id="section5" class="fluid">
<article>
<h2 class="content-title"> 活動及刊物</h2>
<ul class="content-list">
<li class="content-list-bold">新春團拜</li>
<li>日期︰2015年3月14日(星期六)</li>
<li>地點︰金鐘添馬公園添馬茶座愛烘焙餐廳</li>
<li>時間︰下午4:00- 5:30</li>
</ul>
<hr>
<ul class="content-list">
<li class="content-list-bold">第一次周年大會</li>
<li>日期︰2015年3月14日(星期六)</li>
<li>地點︰金鐘添馬公園添馬茶座愛烘焙餐廳</li>
<li>時間︰下午3:30- 4:00</li>
</ul>
<hr>
<ul class="content-list">
<li class="content-list-bold">協會發展成長分享會</li>
<li>日期︰2015年2月3日(星期二)</li>
<li>地點︰金鐘添馬公園添馬茶座愛烘焙餐廳</li>
<li>時間︰上午11:00- 下午4:00</li>
<li>內容:</li>
<li>1. Delifrance午膳</li>
<li>2. 匯報協會最新發展,就大家感興趣的事務進行商討</li>
<li>3. IT人Ben Wong 個人經歷分享</li>
<li>4. 參觀香港大學校園或自由活動</li>
</ul>
<hr>
</article>
</div>
<!--end of section5-->
</div>
<!--end of content-->
</div>
<!--end of gridContainer-->
http://codepen.io/anon/pen/xGgbKN
Add this to the places you want to send the links (wher the anchors are). For ex:
<div id="section2" class="fluid" name="section2">
Then change your links:
成立背景
And add this script to your page footer:
var menuContainer = $('header').height();
function scrollToAnchor(anchorName){
var aTag = $("div[name='"+ anchorName +"']");
$('html,body').animate({scrollTop: aTag.offset().top - menuContainer },'slow');
}
Finally here's a Fiddle: http://jsfiddle.net/x2skzp1p/
Cheers