How to fix footer moving with hyperlinked images - html

This is the problem I've been having. I have recently started to learn about web development and have begun making my own mini games website, but i ran into a problem with my footer and hyperlinked images, due to me being new to this i have not been able to figure the issue out despite looking for answers online.
The issue I'm having is that when i add hyperlinked images to the pages where i want the games to be, the footer moves from the bottom of the page to where the images are, as well as this the footer then becomes hyperlinked itself making it a clickable link to one of the pages where a game will be, I'd like to have the images in an aside which will be for 'Recommended Games' with the game itself being in the centre of the page. When i remove the hyperlinked images this problem no longer occurs. Any feedback will be appreciated, Thank You.
HTML
<aside1>
<div class="container">
<h1>Recommended Games</h1>
</div>
</aside1>
<aside1 id="boxes">
<div class="container">
<div class="box">
<a href="spaceinvader.html">
<img src="img/spaceinvader.jpg">
<h3>Space Invaders</h3>
</div>
<div class="box">
<a href="hangman.html">
<img src="img/hangman.jpg">
<h3>Hangman</h3>
</div>
<div class="box">
<a href="pacman.html">
<img src="img/pacman.jpg">
<h3>Pacman</h3>
</div>
</aside1>
<footer>
<p>ACI Games, Copyright © 2019</p>
</footer>
CSS
aside1{
width:20%;
position:absolute;
top:212px;
bottom:60px;
left:0px;
border-left:6px solid;
border-right:6px solid;
border-color:aqua
}
aside1 h1{
color:white;
text-align:center;
}
footer{
position: absolute;
bottom:0;
width:100%;
height:60px;
background:aqua;
text-align:center;
color:white;
}

you need to close </a> tag.
Here is the updated fiddle:
<aside1>
<div class="container">
<h1>Recommended Games</h1>
</div>
</aside1>
<aside1 id="boxes">
<div class="container">
<div class="box">
<a href="spaceinvader.html">
<img src="img/spaceinvader.jpg"></a>
<h3>Space Invaders</h3>
</div>
<div class="box">
<a href="hangman.html">
<img src="img/hangman.jpg"></a>
<h3>Hangman</h3>
</div>
<div class="box">
<a href="pacman.html">
<img src="img/pacman.jpg"></a>
<h3>Pacman</h3>
</div>
</aside1>
<footer>
<p>ACI Games, Copyright © 2019</p>
</footer>

Related

How to align text on the right side of an image in the header

So, I am trying to get the body text inside the red box that I added in the image attached. It seems like no matter what I do, it just keeps moving down.
Here is the code:
<div class="catalog-center-width one-col-full">
<div class="top-row-grey top-row-white-v2 padding-top padding-side row-v2">
<div class="row dp-row-flex-v2">
<div class="columns large-6 text-center dp-promo-image-wrapper"><img src="https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F3vkvwjz9hnng2dhlfwzj2a5lt%2Fpublic%2F1666809704%2F6527-q2retarget-hc.1666809704408.png" alt="" width="529" height="360" align="left" /></div>
<h1 class="break-word">
<strong>Get started with Ally Lending basics</strong>
</h1>
<div class="sj-course-info-wrapper">
<h2>Find and start conversations, collaborate effectively in channels, find information you need, keep work organized with channels and keep your sidebar organized in Slack.</h2>
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<a class="medium button purchase-button login-link free" href="/checkout/1ycnoni7kt1cn">
<span class="purchase-button-full-text"> Get Started </span>
</a>
</div>
</div>
</div>
</div>
</div>
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<!-- START Walkthrough developer center tile design,
add to page source code -->
</div>
</div>
html,body,h1,h2,h3 {
padding:0;
margin:0;
}
.container {
width:100%;
max-width:80vw;
margin:0 auto;
display:flex;
align-items:center;
justify-content:center;
gap:4rem;
}
.left-col {
width:30%;
}
.left-col img {
width:100%;
height:auto;
}
.right-col {
display:flex;
flex-direction:column;
width:70%;
border:1px solid red;
padding:2rem;
}
<div class="container">
<div class="left-col">
<img src="https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F3vkvwjz9hnng2dhlfwzj2a5lt%2Fpublic%2F1666809704%2F6527-q2retarget-hc.1666809704408.png" alt="" width="529" height="360" align="left" />
</div>
<div class="right-col">
<h1 class="break-word"><strong>Get started with Ally Lending basics</strong></h1>
<h2>Find and start conversations, collaborate effectively in channels, find information you need, keep work organized with channels and keep your sidebar organized in Slack.</h2>
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<a class="medium button purchase-button login-link free" href="/checkout/1ycnoni7kt1cn"><span class="purchase-button-full-text"> Get Started </span>
</a>
</div>
</div>
</div>
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<div id="purchase-button-wrapper-large" class="purchase-button-wrapper">
<!-- START Walkthrough developer center tile design,
add to page source code -->
</div>
</div>

Div above footer is affecting the footer styling, how to fix this?

I am trying to develop a Help me function for our users. For this purpose, I am trying to put a div right above my footer. But, my div styling is affecting the footer, and I am not able to figure out why.
The look I am trying to achieve -
How it looks when I try to implement -
My styling affects the footer styling.
Here is my html code
<div class="help-img pull-right">
<a href="https://google.com">
<img src="~/Content/images/icon-help.png?version=#buildVersion" />
</a>
</div>
<footer class="clearfix">
<div class="pull-left">
<span id="footerYear"></span> © VMS Web #ViewContext.Controller.GetType().Assembly.GetName().Version
</div>
<div class="pull-right">
VMS Web User Guide |
Terms of Use
</div>
</footer>
My CSS -
.help-img {
position: relative;
bottom: 50px;
margin-right: 28px;
}
Any help is appreciated. Thanks
You need to wrap your elements to be able to position them relatively. Or you can use flexbox layout model, which is more suitable in this case.
.wrapper{
display:flex;
flex-direction:column;
}
.help-img {
margin-right: 28px;
align-self:flex-end;
margin-bottom:5px;
background-color:#f1f1f1;
}
.clearfix{
display:flex;
justify-content:space-between;
background-color:#f1f1f1;
}
<div class="wrapper">
<div class="help-img pull-right">
<a href="https://google.com">
<img src="~/Content/images/icon-help.png?version=#buildVersion" />
</a>
Need Help? <strong>Click Here</strong>
</div>
<footer class="clearfix">
<div class="pull-left">
<span id="footerYear"></span> © VMS Web #ViewContext
</div>
<div class="pull-right">
VMS Web User Guide |
Terms of Use
</div>
</footer>
</div>

HTML/CSS link scroll not scrolling to correct position

I'm having trouble figuring out why my links are not scrolling to the correct position. They are scrolling to the section below where they should. I've looked at all the examples I could find to no avail.
<div class="bottomarea">
<div class="bottomareatitles">IDX Website Features</div>
<div class="bottomareasubtitle">WeeboWeb real estate websites have all the tools you need to market yourself and grow your business online. Effective, professional designs that connect you with 32% more buyers and sellers. </div>
<div id="iconcontainer">
<div class="bottomareaicons"><i class="fa fa-laptop" aria-hidden="true"></i><br>Effective Designs</div>
<div class="bottomareaicons"><i class="fa fa-hourglass-half" aria-hidden="true"></i><br>Quick Setup</div>
<div class="bottomareaicons"><i class="fa fa-users" aria-hidden="true"></i><br>Lead Capture</div>
<div class="bottomareaicons"><i class="fa fa-map-marker" aria-hidden="true"></i><br>Map Search</div>
<div class="bottomareaicons"><i class="fa fa-mobile" aria-hidden="true"></i><br>Mobile Friendly</div>
<div class="bottomareaicons"><i class="fa fa-facebook" aria-hidden="true"></i><br>Social Media</div>
<div class="bottomareaicons"><i class="fa fa-comments" aria-hidden="true"></i><br>Blogging</div>
<div class="bottomareaicons"><i class="fa fa-pencil" aria-hidden="true"></i><br>Branding</div>
</div></div>
<div class="bottomsection">
<div class="section">
<h1><a id="effectivedesigns">Effective Designs</a></h1>
<p>sample content</p></a>
</div>
<div class="section">
<h1><a id="quicksetup">Quick Setup</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="leadcapture">Lead Capture</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="mapsearch">Map Search</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="mobilefriendly">Mobile Friendly</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="socialmedia">Social Media</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="blogging">Blogging</a></h1>
<p>sample content</p>
</div>
<div class="section">
<h1><a id="branding">Branding</a></h1>
<p>sample content</p>
</div></div>
Here's the CSS
.bottomarea {display:block; width:100%;}
.bottomareatitles {text-align:center; margin-top:50px; font-size:26px; color:#000000; font-weight:350;}
.bottomareasubtitle {text-align:center; padding-top:20px; color: dimgrey; width:75%; margin:auto;}
.bottomareaicons {width:130px; display:inline-block; margin:auto; text-align:center; margin-top:40px; color:#000000; font-size:16px; padding-bottom:10px; padding-top:10px;}
.bottomareaicons:hover {width:130px; display:inline-block; margin:auto; text-align:center; margin-top:40px; color:#000000; font-size:16px; background:#2584b8; padding-bottom:10px; padding-top:10px;}
.bottomareaicons i {font-size:3.0em; padding-bottom:20px; color:#2584b8;}
.bottomareaicons:hover > i {font-size:3.0em; padding-bottom:20px; color:#ffffff;}
.iconcontainer {margin:auto; text-align:center;}
.bottomsection {margin-top:50px;}
.bottomsection .section h1 {text-align:center;}
.bottomsection .section p {text-align:center;}
You can see a live example of whats happening here: https://www.weeboweb.com/idx-websites/
I'm attempting to just use css to make this work. Any help is greatly appreciated. This has had me a bit baffled.
It's not actually scrolling "below", it's scrolling to where it should. The problem is that area is being covered up by your top navigation which stays fixed to the top of the screen. You need to account for this with your spacing, or don't have a fixed top nav.
Its because you forgot to compensate for your header. The page is scrolling so that the element is at the top of the page... Behind the header.
There are several solutions here in a CSS Tricks article that can help you solve the problem.
Here is the solution: Need to correct the navbar implementation before looking at the bookmark issue
First, add padding-top equal to your header height (76px) to your body.
body {
padding-top: 76px;
}
Next, remove the min-height: 76px, make it 0. from your header. Move the position: fixed from your #main-nav to your header element (if possible, else it is fine to be on #main-nav. Add top:0 to the #main-nav
#main-nav {
top: 0;
}
This should solve your problem.
EDIT:
You are using bootstrap, but not using bootstrap navbar-fixed-to-top solution. please refer this - http://getbootstrap.com/components/#navbar-fixed-top
Also note this at the same place in the bootstrap documentation
Body padding required
The fixed navbar will overlay your other content, unless you add padding to the top of the . Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.
body { padding-top: 70px; }
Make sure to include this after the core Bootstrap CSS.
I was able to fix this by simply adding padding-top:100px; inline to each section element. I did it inline to make sure that the section element doesn't interfere with anything else. I also don't mind the additional space as this particular page warrants it when I finish the design. I don't feel this is the best answer to solving this problem in the future, but in this case it fixed it for me. I also moved the a element outside of the h1 element. You can see ti working here now at https://weeboweb.com.

How do I center 2 divs in HTML Bootstrap?

As the title says, how do I center two divs next to each other perfectly?
My HTML: (or well, a bit of it)
<section class="team" id="team">
<div class="container">
<h3>The team behind CatCraft</h3>
<div class="divider">
<div class="hr">
<div class="hr-dot"></div>
</div>
</div>
<div class="row row-centered">
<div class="team-centered col-md-4">
<img src="http://cravatar.eu/helmhead/6a940db5e02d4bf79db9203a8b126f0d/140.png" alt="catx">
<h4 class="bold">CatX (Owner)</h4>
<p>Hi! I'm CatX and I'm the owner of CatCraft. I like anime and tech stuff. My favourite server is bending. =^_^=</p>
</div>
<div class="team-centered col-md-4">
<img src="http://cravatar.eu/helmhead/ef4fbdb6d629480d8f98ed9919c111e9/140.png" alt="__ast__">
<h4 class="bold">__Ast__ (Co-Owner)</h4>
<p>Example text, pls write something ;-;</p>
</div>
</div>
</div>
</section>
My CSS: (same here, this isn't all)
I tried to make a box for the css above too but it didn't work. http://pastebin.com/SzhAmh3f
Basically the problem I'm having is that the code above works kind of but one of the blocks are a little bit lower than the other and i have no idea why.
Yes, I know that there are other posts about this subject but no one worked for me so I decided to open my own.
There are a lot of unwanted styles actually to achieve this, you simply need the below code on your team-centered class. Remove row-centered class. It should look like this
CSS
.team img {
width: 140px;
height: 140px;
border-radius: 50%;
margin: 10px auto 40px;
}
.team-centered {
width: 50%;
float:left;
text-align: center;
}
HTML
<section class="team" id="team">
<div class="container">
<h3>The team behind CatCraft</h3>
<div class="divider">
<div class="hr">
<div class="hr-dot"></div>
</div>
</div>
<div class="row">
<div class="team-centered">
<img src="http://cravatar.eu/helmhead/6a940db5e02d4bf79db9203a8b126f0d/140.png" alt="catx">
<h4 class="bold">CatX (Owner)</h4>
<p>Hi! I'm CatX and I'm the owner of CatCraft. I like anime and tech stuff. My favourite server is bending. =^_^=</p>
</div>
<div class="team-centered">
<img src="http://cravatar.eu/helmhead/ef4fbdb6d629480d8f98ed9919c111e9/140.png" alt="__ast__">
<h4 class="bold">__Ast__ (Co-Owner)</h4>
<p>Example text, pls write something ;-;</p>
</div>
</div>
</div>
</section>

CSS alignment on my webpage between two elements

I have two elements on my page which I wish to align side by side, what would be the best way of going about this, and can somebody explain the best way to go about coding it when you want to align elements together.
In this example I want the video to take up most of the room say 3/4 and the chart to be in the remaining 1/4. (Bootstrap is loaded on this page)
Any suggestions?
This is what it currently looks like:
http://i1057.photobucket.com/albums/t390/Alexwileyy/element_zps066ecdd2.png
(I have outlined the video in a color so I can see the perimeters)
This is my HTML code for the two elements:
<!--Video Section-->
<div class="video">
<div class="container">
<div class="video-element">
<iframe width="460" height="215" src="//www.youtube.com/embed/PdABTJhRTLY" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<!--End Of Video Section-->
<!--Start of chart-->
<div class="container">
<div class="chart">
<div class="chart-cont">
<h1 id="chart-header">Charts</h1>
</div>
<div class="chart-cont">
<h1>1</h1>
<img src="http://www.spotlightreport.net/wp-content/uploads/2013/06/gran-tourismo-6-banner-3.jpg">
View Review</td>
</div>
<div class="chart-cont">
<h1>2</h1>
<img src="http://savegameonline.com/wp-content/uploads/2013/05/CoD-Ghosts-banner.png">
View Review</td>
</div>
<div class="chart-cont">
<h1>3</h1>
<img src="http://bit.ly/1tSu4iq">
View Review</td>
</div>
<div class="chart-cont">
<h1>4</h1>
<img src="http://www.spotlightreport.net/wp-content/uploads/2013/06/gran-tourismo-6-banner-3.jpg">
View Review</td>
</div>
<div class="chart-cont">
<h4>View More..</h4>
</div>
</div>
</div>
<!--End of chart-->
This is my CSS code for my two elements:
.chart {
background-color:white;
width:400px;
margin-bottom:10px;
margin-top:-35px;
}
.chart-cont * {
display:inline;
}
.chart-cont {
padding:10px;
box-shadow: 0 2px 5px rgba(26,26,26,0.75);
text-align:center;
}
.chart-cont img {
width:180;
height:60px;
}
.chart-cont h1 {
vertical-align:middle;
}
Any answers greatly appreciated.
First if you want to work with 3/4 of the screen, start using a percentage as width.
First create a content Div, then a LeftContent and a RightContent div.
Like this:
<div class="Content">
<div class="LeftContent">
</div>
<div class="RightContent">
</div>
</div>
CSS:
.Content{
width:100%;
margin:10px;
padding:10px;
}
.LeftContent{
width:60%;
margin:10px;
float:left;
}
.RightContent{
width:30%;
margin:10px;
float:right;
}
Now you can place the video left, and the other images right, adjust how you want to with padding, margin and width percentage, test with making your window smaller (how it looks like on smaller screens).
Notice to make use of float left and float right.
Here is JSFiddle link: http://fiddle.jshell.net/7pp7q/1/