How to align images horizontally with auto width using CSS? - html

I am making some social buttons to show horizontally aligned centre in mobile. Now there are 4 buttons and each button is made using an image so it is getting difficult to align those properly.
This is my code:
.sc1 {
width: 100%;
margin: 5px 0px;
background-color: #3498DB;
display: inline-block;
padding: 5px 10px;
border: 2px solid black;
}
.sc2 {
float: right;
border: 2px solid green;
}
.sc3 {
color: white;
float: left;
border: 2px solid red;
padding: 5px 0px;
}
.sc4 {
display: flex;
flex-direction: row;
/*width: 168px;*/
border: 2px solid yellow;
}
.sc4 .facebook-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: 0 0;
margin: 0px 5px;
}
.sc4 .twitter-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -32px 0px;
margin: 0px 5px;
}
.sc4 .google-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -125px 0px;
margin: 0px 5px;
}
.sc4 .instagram-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -63px 0px;
margin: 0px 5px;
}
#media only screen and (max-width: 400px) {
.sc2 {
width: 100%;
}
.sc3 {
width: 100%;
text-align: center;
}
}
<div class="sc1">
<div class="sc2">
<div class="sc3">
<span>Connect with us:</span>
</div>
<div class="sc4">
<a href="http://www.facebook.com" title="Like us on Facebook">
<div class="facebook-icon"></div>
</a>
<a href="http://www.twitter.com" title="Follow us on Twitter">
<div class="twitter-icon"></div>
</a>
<a href="http://www.google.com" title="Like us on Google+">
<div class="google-icon"></div>
</a>
<a href="http://www.instagram.com" title="Follow us on Instagram">
<div class="instagram-icon"></div>
</a>
</div>
</div>
</div>
What should be done to align the buttons in the centre and with equal spacing? This is the current status in which I am able to show those buttons right now.
If someone wants to see complete code then you can check it here.

Floats
Keeping things centered and evenly 'widthed'
container {
display: block;
width: 100%;
background-color: hsla(214, 72%, 62%, 0.2);
overflow-y: auto; /* normalizes div height of float parent */
}
imgblock {
float: left;
width: 25%;
text-align: center; /* center images */
padding: 10px; /* if you want to add padding.. */
border: 1px solid hsla(0, 0%, 0%, 0.1); /* .. or borders .. */
box-sizing: border-box; /* use this to properly calculate width % */
vertical-align: middle;
}
imgblock img {
width: 50px; height: 50px;
vertical-align: middle; /* makes img true to center, vertically speaking */
}
/* unneccesary styling */ imgblock { cursor: pointer; } imgblock:hover { background-color: hsla(64, 98%, 49%, 0.5); } imgblock:hover img { margin-top: -2px; padding-bottom: 2px;
}
<container>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
</container>
fiddle
https://jsfiddle.net/Hastig/d49a4bnh/2/
Flexbox
If you meant an even width of the icon containers here is a flexbox solution
container {
display: flex;
width: 100%;
background-color: hsla(214, 72%, 62%, 0.2);
}
imgblock {
display: flex;
justify-content: center; /* centers images */
flex: 1; /* enlarge each element equally to its maximum */
padding: 10px;
}
imgblock img {
width: 50px; height: 50px;
}
/* unneccesary styling */ imgblock { cursor: pointer; } imgblock:hover { background-color: hsla(64, 98%, 49%, 0.5); } imgblock:hover img { margin-top: -2px; padding-bottom: 2px;
}
<container>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
</container>
fiddle
https://jsfiddle.net/Hastig/d49a4bnh/
Inline Blocks
Here's a possible solution using inline-blocks and percentage widths
container {
display: block;
width: 100%; /* set a width so the children can calculate their widths */
background-color: hsla(214, 72%, 62%, 0.2);
font-size: 0; /* negates the space inline-blocks add after each element, font bug/flaw */
}
imgblock {
display: inline-block;
width: 25%; /* keeps each img container even */
text-align: center; /* centers the images */
padding: 10px; /* if you want to add padding.. */
box-sizing: border-box; /* use this to properly calculate width % */
}
imgblock img {
width: 50px; height: 50px;
}
/* unneccesary styling */ imgblock { cursor: pointer; } imgblock:hover { background-color: hsla(64, 98%, 49%, 0.5); } imgblock:hover img { margin-top: -2px; padding-bottom: 2px;
}
<container>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
<imgblock><img src="http://i.imgur.com/fIyyVWZ.png"></imgblock>
</container>
fiddle
https://jsfiddle.net/Hastig/d49a4bnh/1/

OK, to make it work I had to add a couple of things to your code (I also changed a little bit to make it all the right sizes).
I added width: calc(100% - 20px); to .sc1 so that it wasn't 100% of the page + 10px.
I did the same to .sd2 within the media query.
I added .sc4 {width: 100%;} to the media query so it took up all the space it could.
I added .sc4 a {flex: 1;} to the main css, meaning each a within .sc4 will take up all the space it can.
Finally, I changed the margin for each div to margin: 0px auto; so they would appear in the center of the a tags.
Here is the final result.
.sc1 {
width: calc(100% - 20px);
margin: 5px 0px;
background-color: #3498DB;
display: inline-block;
padding: 5px 10px;
border: 2px solid black;
}
.sc2 {
float: right;
border: 2px solid green;
}
.sc3 {
color: white;
float: left;
border: 2px solid red;
padding: 5px 0px;
}
.sc4 {
display: flex;
flex-direction: row;
/*width: 168px;*/
border: 2px solid yellow;
}
.sc4 a {
flex: 1;
align-items: center;
text-align: center;
}
.sc4 .facebook-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: 0 0;
margin: 0px auto;
}
.sc4 .twitter-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -32px 0px;
margin: 0px auto;
}
.sc4 .google-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -125px 0px;
margin: 0px auto;
}
.sc4 .instagram-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -63px 0px;
margin: 0px auto;
}
#media only screen and (max-width: 400px) {
.sc2 {
width: calc(100% - 20px);
float: none;
}
.sc3 {
width: 100%;
text-align: center;
}
.sc4 {
width: 100%;
}
}
<div class="sc1">
<div class="sc2">
<div class="sc3">
<span>Connect with us:</span>
</div>
<div class="sc4">
<a href="http://www.facebook.com" title="Like us on Facebook">
<div class="facebook-icon"></div>
</a>
<a href="http://www.twitter.com" title="Follow us on Twitter">
<div class="twitter-icon"></div>
</a>
<a href="http://www.google.com" title="Like us on Google+">
<div class="google-icon"></div>
</a>
<a href="http://www.instagram.com" title="Follow us on Instagram">
<div class="instagram-icon"></div>
</a>
</div>
</div>
</div>
Hope this helps.

Use margin: 0 auto on their parent div to center them horizontally.

Add the <center> tag around all the social icons. It should look like this:
<div class= "sc1">
<div class= "sc2">
<div class= "sc3">
<span>Connect with us:</span>
</div>
<div class= "sc4"><center>
<div class="facebook-icon"></div>
<div class="twitter-icon"></div>
<div class="google-icon"></div>
<div class="instagram-icon"></div>
</center> </div>
</div>
</div>

Simplified a bit....
....removed floats, changed things to display properties, added text align on parent, adjusted margins, got rid of superfluous divs in anchor tags........
.sc1 {
width: 100%;
margin: 5px 0px;
background-color: #3498DB;
padding: 5px 10px;
border: 2px solid black;
text-align: center;
}
.sc2 {
width: calc((42px * 4) + 16px);
/* ^^^^
icon + it's margin/padding * number of icons --
You can remove the +16px..
that is to compensate for the borders on the
elements in this snippet.
Ideally it'll be simply ---
calc(42px * 4);
--- */
margin: 0 auto;
border: 2px solid green; }
.sc3 {
color: white;
border: 2px solid red;
display: block;
vertical-align: top;
width: 100%;
line-height: 32px; /* height of icons */
}
.sc4 {
border: 2px solid yellow;
display: block;
margin: 0 auto;
width: 100%;
}
.sc4 a {
display: inline-block;
width: 32px;
height: 32px;
margin: 0 5px; }
.facebook-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
background-position: 0 0;
}
.twitter-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
background-position: -32px 0px;
}
.google-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
background-position: -125px 0px;
}
.instagram-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
background-position: -63px 0px;
}
#media only screen and (max-width: 400px) {
.sc2 {
width: 100%;
}
.sc3 {
width: 100%;
text-align: center;
}
}
<div class="sc1">
<div class="sc2">
<div class="sc3">
<span>Connect with us:</span>
</div>
<div class="sc4">
</div>
</div>
</div>

I finally got the perfect answer for this problem of mine. If I simply add
.sc4 .facebook-icon, .sc4 .twitter-icon, .sc4 .google-icon, .sc4 .instagram-icon{
margin: 0px auto;
to media query and shift icon classes then it should work properly.
Here is the complete code now.
.sc1 {
width: 100%;
margin: 5px 0px;
background-color: #3498DB;
display: inline-block;
padding: 5px 10px;
}
.sc2 {
float: right;
}
.sc3 {
color: white;
float: left;
padding: 5px 0px;
}
.sc4 {
display: flex;
flex-direction: row;
}
.sc4 .facebook-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: 0 0;
margin: 0px 5px;
}
.sc4 .twitter-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -32px 0px;
margin: 0px 5px;
}
.sc4 .google-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -125px 0px;
margin: 0px 5px;
}
.sc4 .instagram-icon {
background-image: url(https://raw.githubusercontent.com/gurjyot/Social-Connections/master/images/social-connections-icons.png);
height: 32px !important;
width: 32px;
background-position: -63px 0px;
margin: 0px 5px;
}
#media only screen and (max-width: 400px){
.sc2 {
width: 100%;
float: none;
}
.sc3{
width: 100%;
text-align: center;
}
.sc4 {
width: 100%;
}
.facebook-icon, .twitter-icon, .google-icon, .instagram-icon{
width: 25%;
}
.sc4 .facebook-icon, .sc4 .twitter-icon, .sc4 .google-icon, .sc4 .instagram-icon{
margin: 0px auto;
}
}
HTLM Code
<div class= "sc1">
<div class= "sc2">
<div class= "sc3">
<span>Connect with us:</span>
</div>
<div class= "sc4">
<div class="facebook-icon"></div>
<div class="twitter-icon"></div>
<div class="google-icon"></div>
<div class="instagram-icon"></div>
</div>
</div>
</div>

Related

How to make the dark mode effect hit the circles designed with css

I'm using this dark mode toggle that affect all the text plus the background color and when I click on it the colors they switch. But I have a problem with the circles that I've designed. I'd like the dark mode affect the background color of them, having the background inside the circles "lime" on the black background and viceversa. Here's the code and the link to the page:
https://civitonia.com/26993899
HTML:
<div class="grid">
<div class="cell">
<div class="inner">
<div class="circle" style="background-image:url('https://freight.cargo.site/t/original/i/655f74e74d3b88cc9d367ba8cccd79680c3837a84a547f9e03b6f39981f424e0/3.png');"></div>
<div class="caption">
<h3>Chiara Bersani <br> Marta Montanini</h3>
</div>
</div>
</div>
DARK MODE CSS:
.colorOuterSVG {
color: black;
margin-top: 2em;
padding: 0.5em
}
.colorOuterSVG .dark { display: none }
.colorOuterSVG .light { display: block }
.dark-mode .colorOuterSVG {color:#d9ff76!important; }
.dark-mode .colorOuterSVG .dark { display: block }
.dark-mode .colorOuterSVG .light { display: none }
.colorSVG { display: block }
.colorSVG path { fill: currentColor }
.dark-mode {
background-color: black!important;
color: #d9ff76!important;
}
.dark-mode button {
color: black!important;
background-color: #d9ff76;
padding: 5px 5px 5px 5px;
border-radius: 15px;
border: solid 1px #000000;
cursor: pointer;
position: absolute;
bottom: 10px;
}
THE CIRCLES MADE WITH CSS:
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.grid {
display: flex;
flex-wrap: wrap;
max-width: 980px;
width: 100%;
margin: auto;
padding-top: 5%;
padding-bottom: 5%;
}
.cell {
flex-basis: 33.3%;
display: flex;
justify-content: center;
align-items: center;
align-items : flex-start
}
.cell:before {
padding-bottom: 100%;
display: block;
content: '';
}
.circle {
width: 250px;
height: 250px;
border: 0.5px solid;
border-radius: 50%;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
box-shadow: 0px 0px 15px 0px;
overflow: hidden;
margin: 0 auto 1em;
background-color: #d9ff76!important;
}
.circle img {
width: 100%;
position: relative;
height: 100%;
}
h3 {
text-align: center;
}
.inner {
text-align: start;
padding-bottom: 30%;
}
Right now I've set up a background color for the circles and if I take it away the background will stay lime on lime and black on black!
Add this css code for dark mode :
.dark-mode .circle {
background-color: #000 !important;
}

Html Css Card breaking page width for no reason

enter image description here
Hello, I am using next js, and as you can see on the most right of the picture the page has an overflow for no reason and it's caused by an html CSS card I built as shown below in the photo. (I assumed it is because of the card because when I remove it the page works fine):
enter image description here
Below is the code of the card:
<div className={styles.container}>
<Row className={styles.Row}>
<Col data-aos="flip-right" className={styles.Col} sm={'auto'} >
<Link href={"/"}>
<a>
<div className={styles.aBox}>
<div className={styles.imgContainer}>
<div className={styles.imgInner}>
<div className={styles.innerSkew}>
<img src="./topbanner2.jpg" />
</div>
</div>
</div>
<div className={styles.textContainer}>
<h3>Flyer</h3>
<div>
This is a demo experiment to skew image container. It looks good.
</div>
</div></div></a></Link>
</Col>
<Col data-aos="flip-right" className={styles.Col} sm={'auto'} >
</Col>
....
below is the css:
.Col a:hover{
text-decoration: none;
color: black;
}
.Row{
width: 80%;
margin: auto;
}
.Col{
padding: 10px !important;
margin: auto;
text-align: center;
overflow-x: hidden !important;
}
.aBox {
display: inline-block;
width: 240px;
text-align: center;
box-sizing:content-box;
}
.aBox:hover{
.textContainer{
border:#04bcff solid 1px
}
}
.imgContainer {
height: 230px;
width: 200px;
overflow: hidden;
border-radius: 0px 0px 20px 20px;
display: inline-block;
}
.imgContainer img {
/* transform: skew(0deg, -13deg); */
height: 250px;
width: 100%;
object-fit: cover;
/* margin: -35px 0px 0px -70px; */
}
.innerSkew {
display: inline-block;
border-radius: 20px;
overflow: hidden;
padding: 0px;
/* transform: skew(0deg, 13deg); */
font-size: 0px;
margin: 30px 0px 0px 0px;
background: #c8c2c2;
height: 250px;
width: 200px;
}
.textContainer {
border:transparent solid 1px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
padding: 120px 20px 20px 20px;
border-radius: 20px;
background: #fff;
margin: -120px 0px 0px 0px;
line-height: 19px;
font-size: 14px;
transition: 0.25s border ease-in-out;
}
.textContainer h3 {
margin: 20px 0px 10px 0px;
color: #04bcff;
font-size: 18px;
}
Any suggestions what would be it?
Add
body * {outline:1px solid red;}
to the CSS file to see the overflowing component.
Pls this trick I learned from Kevin Powell (search him on YouTube)

Alternative for line-height to vertically center flexbox item text? [duplicate]

This question already has answers here:
How can I vertically align elements in a div?
(28 answers)
How can I center text (horizontally and vertically) inside a div block?
(27 answers)
Flexbox: center horizontally and vertically
(14 answers)
css single or multiple line vertical align
(8 answers)
Closed 10 months ago.
I've included the JSFiddle below.You have to shrink the size to about 670px to see the issue. What I am trying to fix are the flexbox items at the bottom of the page where the footer says "call xxx-xxx-xxxx". It is hard to see because the background image isn't loaded on the JSFiddle, but when the screen shrinks, the text "to schedule a consultation" pushes into the white background. Initially I used the line height trick, making it equal to the container height, so it vertically centers my first line of text but pushes the second line 100px down off the footer. What I am going for is to make both lines of text center vertically together instead of 100px apart.
https://jsfiddle.net/4m7pysqb/
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<title>DLGTreecare - Home</title>
<link rel="icon" href="images/favicon-16x16.png">
<link rel="Stylesheet" href="DLGtreecare.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome#1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght#400;500&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="dlg.js"></script>
</head>
<body>
<div class="header">
<div class="heroimagecontainer">
<img class="heroimage" src="images/heroimage.jpg">
</div>
<div class="redbar">
</div>
<div class="orangebar">
</div>
</div>
<div class="wrapper">
<div class="logowrapperdiv">
<div class="logoarea"> <p class="dlg">DLG Tree Care </p> <img class="logo" src="images/logotransparent.png"> </div>
<p class="undertree">Professional Tree Services</p>
</div>
<!-- https://drive.google.com/file/d/1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy/preview
https://drive.google.com/uc?export=view&id=1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy
-->
<div class= maincontent>
<p class="intro">PROVIDING THE "518" WITH ALL YOUR TREE CARE NEEDS!</p>
<iframe class="videointro" src="https://drive.google.com/file/d/1YcJmJO-7mKo1er338P4AQ9Kn6HohaJsy/preview" allow="autoplay"></iframe>
<div> </div>
<div class="phonebar"> Call 518-407-9500 for a free estimate!</div>
<div class="messagebuttontext"> Or message us on
<a class="messagebutton" href="https://m.me/DLGTreeCare">
<span style=color:orange>Facebook!</span>
<i class="fa fa-facebook-messenger fa-1x" aria-hidden="true"></i>
</a></div>
<div class="clearfix"></div>
</div>
<h2>Services</h2>
<h6>(Click images to see "before and after")</h6>
<div class="services">
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Tree Removal</p><p class="servicedescription ">Removing dead or unwanted trees is sometimes a must, using the proper skills this can be done safely</p>
<img class="toggleon" src = "images/beforeafter/treeremovalflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Tree Trimming</p><p class="servicedescription ">Having your trees trimmed properly is important and can help maintain healthy future growth</p>
<img class="toggleon" src = "images/beforeafter/treetrimmingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Stump Grinding</p><p class="servicedescription">By grinding the stump of the tree we are able to totally remove the stump in order to grow grass or replant something new</p>
<img class="toggleon" src = "images/beforeafter/stumpgrindingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Hedge Trimming</p><p class="servicedescription ">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/hedgetrimmingflip300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Fruit Tree Pruning</p><p class="servicedescription">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/fruittreeflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Wood & Brush Removal</p><p class="servicedescription">From big to small, we have the tools and expertise for all your needs</p>
<img class="toggleon" src = "images/beforeafter/treeremovalflip300x400.png">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Lot Clearing</p><p class="servicedescription">We can turn any wooded lot into an open usable space for the building of Homes, Businesses, etc.</p>
<img class="toggleon" src = "images/beforeafter/lotclearingflip300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Cabling & Bracing</p><p class="servicedescription">Large branches and/or weak crotches sometimes can split under their own weight, cabling can keep this from happening without damaging the tree</p>
<img class="toggleon" src = "images/beforeafter/cablingbracingflip_300x400.jpg">
</div>
<div class="servicenode"><button class="mybutton" type="button">></button><p class="servicetitle">Storm Damage</p><p class="servicedescription">We're available 24/7 for any tree related emergencies</p>
<img class="toggleon" src = "images/beforeafter/stormdamageflip_300x400.jpg">
</div>
</div>
<h2>See more of our work</h2>
<div class="gallery">
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized95FB95IMG951628801998990.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/FB95IMG951628860144118.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/FB_IMG_1628860108712.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210319_094919.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210325_104241.jpg"></div>
<div class="gallerynode"><img class="galleryimg" src="images/GALLERY/Resized_20210322_131140.jpg"></div>
</div>
<div class="flex-container">
<div class="flex-item">Serving the 518 area</div><div class="flex-item">Call 518-407-9500 to schedule a consultation.</div>
</div>
</div>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root{
/* base red */
--base-red: 10;
/* base yellow */
--base-yellow: 60;
/* base green */
--base-green: 99;
/*base blue*/
--base-blue: 200;
/* colors */
--brown-normal: hsla(17, 42%, 41%, 100%);
--brown-normal: hsla(17, 42%, 41%, 100%);
--red-light: hsla(var(--base-red), 100%, 75%, 100%);
--red-normal: hsla(var(--base-red), 100%, 45%, 100%);
--red-darker: hsla(var(--base-red), 100%, 35%, 100%);
--yellow-light: hsla(var(--base-yellow), 50%, 75%, 100%);
--yellow-normal: hsla(var(--base-yellow), 50%, 50%, 100%);
--yellow-darker: hsla(var(--base-yellow), 50%, 35%, 100%);
--green-light: hsla(var(--base-green), 50%, 75%, 100%);
--green-normal: hsla(var(--base-green), 50%, 50%, 100%);
--green-darker: hsla(var(--base-green), 50%, 35%, 100%);
--blue-light: hsla(var(--base-blue), 50%, 75%, 100%);
--blue-normal: hsla(var(--base-blue), 50%, 50%, 100%);
--blue-darker: hsla(var(--base-blue), 50%, 35%, 100%);
}
#font-face {
font-family: TreeHuggerMedium-lEqZ;
src: url(TreeHuggerMedium-lEqZ.ttf);
}
body {
min-height: 100vh;
max-height: 195.625rem;
background-image: url("images/stump.jpg");
background-color: white;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
margin: auto;
}
div.header {
min-width: 320px;
text-align: center;
height: 300px;
}
div.heroimagecontainer {
height: 210px;
width: inherit;
}
img.heroimage {
height: 100%;
width: 100%;
object-fit: cover;
}
div.redbar {
width: inherit;
background-color: var(--red-normal);
height: 20px;
}
div.orangebar {
width: inherit;
background-color: orange;
height: 70px;
}
div.logowrapperdiv {
min-width: 320px;
max-width: 1000px;
position: relative;
height: auto;
margin: auto;
top: -50px;
}
div.logoarea {
border-bottom-style: solid;
border-color: white;
border-width: 5px;
min-width: 320px;
max-width: 525px;
margin: auto;
height: 92px;
color: white;
position: relative;
}
img.logo {
max-width: 36.5%;
top: -188px;
display: block;
left: 17%;
position: relative;
overflow: visible;
z-index: 105;
object-fit: contain;
}
p.dlg {
font-family: Roboto Slab;
position: relative;
max-width: 525px;
min-width: 320px;
font-size: 3.9em;
font-weight: 500;
text-align: center;
white-space: pre;
top: 20px;
}
.undertree {
font-family: Roboto Slab;
font-weight: 500;
max-width: 525px;
color: white;
text-align: center;
height: 50px;
margin: auto;
margin-top: 0;
padding-bottom: 40px;
letter-spacing: 0.10em;
font-size: 2.16em;
position: relative;
top: 0px;
}
.wrapper {
margin: auto;
min-width: 320px;
max-width: 1000px;
background-image: linear-gradient(var(--brown-normal), orange);
padding-top: 50px;
border-radius: 0px 0px 5px 5px;
}
.maincontent {
min-width: 320px;
text-align: center;
height: auto;
color: white;
position: relative;
margin-bottom: 25px;
padding: 15px;
}
.intro {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.7em;
color: white;
text-align: center;
padding-bottom: 25px;
min-width: 300px;
max-width: 1000px;
}
.videointro {
min-width: 300px;
min-height: 225px;
position: relative;
display: block;
border-style: solid;
border-width: 2px;
border-color: white;
border-radius: 5px;
margin: auto;
}
.phonebar {
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
position: relative;
float: left;
min-width: 295px;
max-width: 550px;
margin: 25px 0px 0px 20px;
font-size: 1.7em;
border: 1px solid white;
padding: 5px;
border-radius: 15px;
}
.phonebar a {
color: orange;
text-decoration: none;
}
.messagebutton {
display: inline-block;
text-align: center;
color: orange;
position: relative;
margin: auto;
text-decoration: none;
}
.messagebuttontext {
min-width: 295px;
max-width: 550px;
color: white;
position: relative;
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.7em;
display: block;
float: right;
border: 1px solid white;
border-radius: 15px;
margin: 25px 20px 0px 0px;
padding: 5px;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
/*code for photo galley */
h2 {
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
font-size: 5em;
color: white;
margin: 50px auto;
position: relative;
}
h6 {
font-size: 2em;
font-family: Roboto Slab;
font-weight: 400;
text-align: center;
color: white;
position: relative;
margin: 10px auto;
}
button {
appearance: button;
background-color: white;
color: red;
cursor: pointer;
font-weight: 500;
border-color: white;
z-index: 101;
top: 30px;
left: 0px;
position: relative;
border-radius: 5px;
height: 25px;
width: 25px;
margin: 0 auto;
border-width: 1px;
transition: transform .3s linear;
}
.buttonrotate {
transform: rotate(90deg);
}
.services {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
width: auto;
height: auto;
margin: auto;
}
.servicenode {
position: relative;
width: 300px;
margin: auto;
margin-bottom: 25px;
}
.servicenode img {
display: block;
margin-left: auto;
margin-right: auto;
width: 300px;
height: 200px;
object-fit: none;
border: 1px solid red;
border-radius: 8px;
transition: 0.1s object-position ease;
position: relative;
}
.servicetitle {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.4em;
vertical-align:top;
display:inline-block;
color: white;
width: 100%;
position: relative;
text-align: center;
margin-bottom: 10px;
}
.servicedescription {
font-family: Roboto Slab;
font-weight: 400;
font-size: 1.2em;
color: white;
z-index: 100;
transition-property: opacity, border-radius;
transition-duration: .4s;
transition-timing-function: linear;
opacity: 0;
margin: auto;
width: 298px;
position: absolute;
display: block;
background: rgba(0,0,0, 0.6);
left: 0;
right: 0;
border-radius: 8px 8px 8px 8px;
text-align: center;
user-select: none; /* supported by Chrome and Opera */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
pointer-events: none;
}
.servicedescriptionshow {
position: absolute;
display: block;
width: 298px;
left: 0;
right: 0;
border-radius: 8px 8px 0px 0px;
text-align: center;
opacity: 1;
}
.toggleon {
object-position: top;
cursor: pointer;
}
.toggleoff {
object-position: bottom;
cursor: pointer;
}
/* Gallery stuff */
.gallery {
display: grid;
grid-template-columns: repeat(2, minmax(320px, auto));
width: auto;
height: auto;
margin: auto;
}
.gallerynode {
color: white;
text-align: center;
position: relative;
margin: auto;
border-width: 1px;
border-style: solid;
border-color: white;
height: 490px;
}
.galleryimg {
object-fit: cover;
width: 490px;
height: 490px;
}
/* footer stuff */
.footer {
height: 5vh;
width: 100%;
background-color: white;
position: relative;
margin-top: 100px;
bottom: 0;
border-style: solid;
border-color: red;
border-width: 3px;
border-radius: 0px 0px 5px 5px;
}
.flex-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin-top: 10px;
}
.flex-item {
-ms-flex-preferred-size: 33%;
flex-basis: 50%;
background-color: orange;
padding: 5px;
height: 100px;
color: white;
font-weight: bold;
font-size: 1.5em;
text-align: center;
border: 1px solid #333;
box-sizing: border-box;
line-height: 100px;
}
.flex-item a {
color: white;
}
/* media queries */
#media screen and (max-width: 1000px) {
div.maincontent {
height: auto;
}
.messagebuttontext {
float: none;
margin: 20px auto;
}
.phonebar {
float: none;
margin: 20px auto;
}
.gallery {
grid-template-columns: repeat(1, minmax(320px, auto));
}
.flex-item {
font-size: 1em;
}
}
#media screen and (max-width: 545px) {
div.logoarea {
width: 420px;
}
p.dlg {
font-size: 3em;
top: 35px;
}
img.logo {
left: 17%;
top: -130px;
}
.undertree {
font-size: 1.6em;
}
}
#media screen and (max-width: 500px) {
.gallerynode {
height: 320px;
}
.galleryimg {
object-fit: cover;
width: 320px;
height: 320px;
margin: auto;
}
}
#media screen and (max-width: 485px) {
div.logoarea {
width: 320px;
}
img.logo {
top: -86px;
left: 16%
}
p.dlg {
font-size: 2.6em;
top: 42px;
}
}
#media screen and (max-width: 354px) {
p.dlg {
font-size: 2.6em;
top: 42px;
}
.undertree {
font-size: 1.39em;
}
img.logo {
top: -86px;
}
.maincontent {
padding: 8px;
}
}
JS
$(document).ready(function(){
$(".servicenode > img").click(function(){
$(this).toggleClass('toggleon toggleoff');
});
$(".mybutton").click(function() {
$(this)
.siblings(".servicedescription")
.toggleClass('servicedescriptionshow');
$(this).toggleClass('buttonrotate');
});
});

Making an Image Dynamic

I have 2 problems.
I have 2 images at the bottom of my page, and when the browser size shrinks, the images don't resize and get cut off, I have tried have tried to use width: 100% and height: auto. I have tried a media query I found, but nothing seems to be working, I'm pretty new to HTML and CSS so maybe its a problem with my HTML code, I will post it to the bottom for you guys to check out.
Second problem is, I have managed to have my footer element always stick to the bottom of the page regardless of the height of the page, however when the browser size shrinks, the footer is transparent and lies on top of the images, which is obviously ugly. I want the footer to always remain a certain distance away from all other elements and stick to the bottom.
I hope you can help, Thanks :)
body {
font-family: Rajdhani;
color: white;
width: 100%;
height: 100%;
}
/* ============== NAV BAR =================*/
#media (max-width: 992px) {
.navbar-collapse li a {
color: black;
padding: 300px;
}
}
.nav>li>a:focus,
.nav>li>a:hover {
background-color: transparent !important;
color: #CCCCCC;
border-bottom: 3px solid #FFFFFF;
padding-bottom: 5px;
}
.dropdown-menu li,
.dropdown-menu a {
padding: 5px 0px 5px 0px;
margin: 0px;
color: white;
background-color: white;
}
.logo {
width: 7em;
}
.navbar {
font-family: Rajdhani;
}
.collapse .navbar-collapse {
background: black;
}
.navbar-toggle .icon-bar {
background-color: #fff;
margin-top: 5.5em;
}
li a {
color: white;
margin-top: 2.5em;
font-size: 1.5em;
}
#divider1 {
padding: 0px;
margin: 0px;
}
#divider2 {
padding: 0px;
margin: 0px;
}
/* ============== SLIDE 1 =================*/
#slide1 {
background: url(dojo.jpg) 50% 0 no-repeat fixed;
background-size: cover;
height: 450px;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
min-height: 100%;
position: relative;
}
/* ============== SLIDE 2 =================*/
#slide2 {
background-color: #fff;
color: #333333;
height: 1150px;
margin: 0 auto;
overflow: hidden;
padding-top: 15px;
position: relative;
padding-bottom: 200px;
}
.headers h1 {
color: white;
display: block;
margin-top: 90px;
font-family: Rajdhani;
text-align: center;
font-size: 80px;
}
.headers2 {
text-align: center;
font-family: Rajdhani;
}
hr {
border: 0;
height: 1px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
width: 85%;
}
.aboutcontent {
font-family: Rajdhani;
margin: 0px 100px 0px 100px;
font-size: 20px;
text-align: center;
}
#aboutimages {
text-align: center;
display: flex;
justify-content: center;
}
.aboutimages1 {
width: 300px;
height: 375px;
margin: 40px 10px 0px 0px;
}
.aboutimages2 {
width: 300px;
height: 375px;
margin: 40px 0px 0px 10px;
}
/* ============== CONTACT BAR =================*/
#contact {
position: absolute;
font-family: Rajdhani;
font-size: 1em;
text-align: center;
bottom: 0;
width: 100%;
height: 260px;
}
#info {
width: 100%;
}
.logo2 {
width: 7em;
padding-bottom: 0.5em;
}
<div id="slide2">
<div class="headers2">
<h2><strong>GOSPORT & FAREHAM'S HOME OF CHAMPIONS!</strong></h2>
<hr>
</div>
<div class="aboutcontent">
<p>CONTENT</p>
<p>CONTENT</p>
</div>
<div id="aboutimages">
<img class="aboutimages1" src="https://www.gettyimages.ie/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg">
<img class="aboutimages2" src="https://listaka.com/wp-content/uploads/2015/07/baby-boy-wearing-hat.jpg">
</div>
<div id="contact">
<div id="info">
<footer>
<hr>
<img class="logo2" src="#"><br> CONTACT INFO <br> CONTACT INFO <br> CONTACT INFO <br> CONTACT INFO <br>
<i class="fab fa-facebook-square fa-2x"></i>
<i class="fab fa-instagram fa-2x"></i>
<i class="fas fa-envelope fa-2x"></i>
</footer>
</div>
</div>
</div>
I apologise for the mass of code, im not quite sure what it is thats wrong, so thought id try provide enough info. Thanks guys ::)
It will cut off due to the following reason
Parent Property - overflow:hidden;
Child Property - width:300px; (It's in px)
Pixel value will force your image to stay rigid and your hidden overflow will not let your image to grow outside the container.
Solution:
Let's keep overflow:hidden; as it is but add media-query to it
Variations you can try with media-query
As I have shown, you can get 2 images one over another
You can remove px value from your width, and change it with % value
body {
font-family: Rajdhani;
color: white;
/* width: 100%; */
height: 100%;
}
/* ============== NAV BAR =================*/
#media (max-width: 992px) {
.navbar-collapse li a {
color: black;
padding: 300px;
}
}
.nav>li>a:focus,
.nav>li>a:hover {
background-color: transparent !important;
color: #CCCCCC;
border-bottom: 3px solid #FFFFFF;
padding-bottom: 5px;
}
.dropdown-menu li,
.dropdown-menu a {
padding: 5px 0px 5px 0px;
margin: 0px;
color: white;
background-color: white;
}
.logo {
width: 7em;
}
.navbar {
font-family: Rajdhani;
}
.collapse .navbar-collapse {
background: black;
}
.navbar-toggle .icon-bar {
background-color: #fff;
margin-top: 5.5em;
}
li a {
color: white;
margin-top: 2.5em;
font-size: 1.5em;
}
#divider1 {
padding: 0px;
margin: 0px;
}
#divider2 {
padding: 0px;
margin: 0px;
}
/* ============== SLIDE 1 =================*/
#slide1 {
background: url(dojo.jpg) 50% 0 no-repeat fixed;
background-size: cover;
height: 450px;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
min-height: 100%;
position: relative;
}
/* ============== SLIDE 2 =================*/
#slide2 {
background-color: #fff;
color: #333333;
height: 1150px;
margin: 0 auto;
overflow: hidden;
padding-top: 15px;
position: relative;
padding-bottom: 200px;
}
.headers h1 {
color: white;
display: block;
margin-top: 90px;
font-family: Rajdhani;
text-align: center;
font-size: 80px;
}
.headers2 {
text-align: center;
font-family: Rajdhani;
}
hr {
border: 0;
height: 1px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
width: 85%;
}
.aboutcontent {
font-family: Rajdhani;
margin: 0px 100px 0px 100px;
font-size: 20px;
text-align: center;
}
#aboutimages {
text-align: center;
display: flex;
justify-content: center;
}
.aboutimages1 {
width: 300px;
height: 375px;
margin: 40px 10px 0px 0px;
}
.aboutimages2 {
width: 300px;
height: 375px;
margin: 40px 0px 0px 10px;
}
/* ============== CONTACT BAR =================*/
#contact {
position: absolute;
font-family: Rajdhani;
font-size: 1em;
text-align: center;
bottom: 0;
width: 100%;
height: 260px;
}
#info {
width: 100%;
}
.logo2 {
width: 7em;
padding-bottom: 0.5em;
}
#media screen and (max-width: 621px) {
#aboutimages {
flex-direction: column;
}
#info {
margin-top: 60px;
}
.aboutimages1 {
margin: auto;
}
.aboutimages2 {
margin: auto;
}
}
<div id="slide2">
<div class="headers2">
<h2><strong>GOSPORT & FAREHAM'S HOME OF CHAMPIONS!</strong></h2>
<hr>
</div>
<div class="aboutcontent">
<p>CONTENT</p>
<p>CONTENT</p>
</div>
<div id="aboutimages">
<img class="aboutimages1" src="https://www.gettyimages.ie/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg">
<img class="aboutimages2" src="https://listaka.com/wp-content/uploads/2015/07/baby-boy-wearing-hat.jpg">
</div>
<div id="contact">
<div id="info">
<footer>
<hr>
<img class="logo2" src="#"><br> CONTACT INFO <br> CONTACT INFO <br> CONTACT INFO <br> CONTACT INFO <br>
<i class="fab fa-facebook-square fa-2x"></i>
<i class="fab fa-instagram fa-2x"></i>
<i class="fas fa-envelope fa-2x"></i>
</footer>
</div>
</div>
</div>

Background outside CSS Bottom Border

first question here so please be kind! I am designing a website and I've been asked to frame pictures in sine-like borders. So far I've gotten around to it by creating a container div with 3 divs: the first for the downward bend, the second is just straight (I'm considering the idea of removing it later on) and the third one does the upward bend.
Here's a screenshot of the current state
So this is the the current code:
.border {
overflow: hidden;
align-items: center;
height: auto;
width: 100%;
display: flex;
}
.bord1 {
margin-top: 4vh;
height: 4vh;
flex: 1;
border-top: solid 5px;
border-color: #e4ae03 rgba(0, 0, 0, 0) transparent transparent;
border-radius: 100% 0 0 0;
z-index: 999;
}
.bord2 {
margin-top: 4vh;
flex: 1;
display: inline;
height: 4vh;
border-top: 5px solid #e4ae03;
}
.bord3 {
margin-top: -4vh;
flex: 1;
height: 4vh;
display: block;
border-bottom: 5px solid;
border-color: transparent transparent #e4ae03 transparent;
border-radius: 0 0 100% 0;
}
<div class="border">
<div class="bord1 top top-bord"></div>
<div class="bord2 top top-bord"></div>
<div class="bord3 bottom"></div>
</div>
I'm really trying to figure out how to get the last segment white, as it's created by rounding the bottom right corner, so the white background would have to be "outside" the div.
I know this might be a stupid question, but here it is! Thanks!
*Edit: Sorry everyone, here is an image of what I'm trying to do]2
It would need minor adjustments to the spacing, but something along these lines? (I used black/white backgrounds to show the sections, but these could be swapped or even made transparent.
body{background-color:black;}
.border{
overflow: hidden;
align-items: center;
height: auto;
width: 100%;
display: flex;
background-color:white;
}
.bord1{
margin-top: 4vh;
height: 4vh;
flex:1;
border-top: solid 5px;
border-color:#e4ae03 rgba(0,0,0,0) transparent transparent;
border-radius: 100% 0 0 0;
z-index: 999;
background-color:black;
}
.bord2 {
margin-top: 4vh;
flex: 1;
display: inline;
height: 4vh;
border-top: 5px solid #e4ae03;
background-color:black;
}
.bord3{
border-bottom: 5px solid;
border-color: transparent transparent #e4ae03 transparent;
border-radius: 0 0 100% 0;
background-color:white;
height:4vh;
}
.bord3-layer{
flex: 1;
height: 9vh;
display: block;
background-color:black;
}
<!DOCTYPE html>
<HTML>
<head>
<style>
</style>
</head>
<body>
<div class="border">
<div class="bord1 top top-bord"></div>
<div class="bord2 top top-bord"></div>
<div class="bord3-layer">
<div class="bord3 bottom"></div>
</div>
</div>
</body>
</HTML>
Ok, in the end I was able to fix the layout using a system of inner divs, here is how I handled it:
.container {
line-height: 1.5rem;
margin-top: -5vh;
padding: 0px 0px 0px;
padding-top: 5vh;
padding-bottom: 0px;
z-index: 0;
color: #b3b5b3;
background: -webkit-linear-gradient(left, #1b2716, #000000 80%);
background: -o-linear-gradient(left, #1b2716, #000000 80%);
background: -moz-linear-gradient(left, #1b2716, #000000 80%);
background: linear-gradient(left, #1b2716, #000000 80%);
min-height: 75vh;
}
.top {
box-shadow: inset 0 6px 0 0px #243c51;
}
.bottom {
box-shadow: 0 6px 0 0px #243c51;
}
.border{
overflow: hidden;
align-items: center;
height: auto;
width: 100%;
display: flex;
}
.bord1{
margin-top: 4vh;
height: 4vh;
flex:1;
border-top: solid 5px;
border-color:#e4ae03 rgba(0,0,0,0) transparent transparent;
border-radius: 100% 0 0 0;
z-index: 999;
}
.bord1-bot{
background: white;
}
.bord2 {
margin-top: 4vh;
flex: 1;
display: inline;
height: 4vh;
border-top: 5px solid #e4ae03;
}
.bord2-bot {
background: white;
margin-bottom: 4vh;
flex: 1;
display: inline;
height: 4vh;
border-bottom: 5px solid #e4ae03;
}
.bord3{
flex: 1;
height: 4vh;
display: block;
border-bottom: 5px solid;
border-color: transparent transparent #e4ae03 transparent;
border-radius: 0 0 100% 0;
}
.bord3-top {
margin-top: 0vh;
background: black;
}
.bord3-bot {
margin-top: 0vh;
background: white;
}
.bord3-bottom {
background: white;
}
.bord3-layer-top{
flex:1;
height: 8.5vh;
display: block;
background-color: white;
}
.bord3-layer-bot{
flex:1;
height: 8.5vh;
display: block;
}
.bord1-layer-top{
flex:1;
height: 8.5vh;
display: block;
background-color: white;
}
.bot-bord {
background: -webkit-linear-gradient(left, #1b2716, #000000 240%);
}
.text-con {
padding: 2vw;
z-index: 2;
}
.image-within {
display: block;
background: yellow;
height: 200px;
z-index: 10;
}
.top-bord {
background: white;
}
<div class="container">
<div class="border">
<div class="bord1 top top-bord"></div>
<div class="bord2 top top-bord"></div>
<div class="bord3-layer-top">
<div class="bord3 bottom bord3-top"></div>
</div>
</div>
<div class="image-within">
</div>
<div class="border">
<div class="bord1-layer-top"><div class="bord1 top bot-bord"></div></div>
<div class="bord2-bot bottom"></div>
<div class="bord3-layer-bot">
<div class="bord3 bottom bord3-bot"></div>
</div>
</div>
</div>
The CSS is really messy at the moment, so I'll have to clean it up a bit and work on keeping all the items constantly aligned, but it's looking pretty good right now! Thanks LegendaryJLD!