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

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>

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>

How to fix footer moving with hyperlinked images

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>

How to achieve this style in css without using position:absolute?

i'm creating a HTML page with Bootstrap 4 from an image.
This is the image:
But i have no idea how to get this style with flexbox.
This is what i have done so far
html:
<section id="recursos">
<div class="container">
<h1 class="como-funciona text-center">Recursos disponíveis</h1>
<div class="text-center"><img src="img/linha.png" class="img-fluid">
<h3 class="ferramenta">Para turbinar o seu negócio no Instagram</h3>
</div>
<div class="container-center">
<div class="left">
<img src="img/icones/like.png">
<h3>teste</h3>
<p>description</p>
<img src="img/icones/comentario.png">
<h3>teste</h3>
<p>description</p>
<img src="img/icones/relatorio.png">
<h3>teste</h3>
<p>description</p>
</div>
<div class="center">
<!-- this is where i was going to put the phone image -->
</div>
<div class="right">
<!-- and here is equal to left elements -->
</div>
</div>
</div>
</section>
css
.container-center{
display:flex;
justify-content: center;
align-items: center;
}
.left{
width:33.33vw;
display: inline-grid;
}
.center{
background:gold;
width:33.33vw;
}
.right{
background:gray;
width:33.33vw;
}
Can you guys please help me solve this problem? I dont know how to place the h3 text along with the description like the image.
I'm able to do it using position absolute but i know its not the right way to do it.
Many thanks.
I don't want to provide the exact answer but, I did draw up something that may help you.
Basically, you just need to remember that you can nest flex box elements inside each other.

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.

CSS3 Navigation Bar: Float:Right

I'm creating and designing a mini social networking website for our school's Science Fair, and I already have a problem at the designing stage. :(
So I've created a few PSDs on how my website should look like, but it seems harder to translate my designs into HTML/CSS. My current trouble right now is this navigation bar that isn't cooperating with me...
In short, this navigation bar is very simple; the logo, with the title, a subtitle, and a few menu options (Login, Sign up). I'm using float:right; to float my options to the right, but that isn't working very well.
The options of my navigation bar are jutting out, below the Navigation Bar. It's really odd; when I take out the float:right; it seems perfectly fine, but is to the left. I would really like it to be on the right side.
A sample of the website is available at http://ticktalk.me.pn/. A PSD of the Sign-Up Page is available here: http://img1.imagilive.com/0314/tickTalk-signup.jpg.
Please feel free to "View Page Source" and investigate what I've done wrong. A direct link to the css is available at http://ticktalk.me.pn/css/style.css.
Thanks in advance.
EDIT:
This is my Navigation Bar HTML...
<div class= "navbar-header">
<div class= "navbar-title"><a href= "#">
tick<span class= "bookfont">talk</span>
</a></div>
<div class= "navbar-subtitle">
social networking around the clock
</div>
<div class= "navbar-menu">
<div class= "navbar-option login-button">
Login
</div>
<div class= "navbar-option navbar-checked signup-button">
Sign Up
</div>
</div>
</div>
and this is my CSS:
.navbar-header {
display:block;
background-color: rgb(0, 241, 73);
padding:10px;
margin-bottom:75px;
}
.navbar-logo {
display:inline-block;
}
.navbar-title {
display:inline-block;
font-size: 52px;
margin-left:10px;
margin-right:5px;
}
.bookfont {
font-weight: 500;
}
.navbar-subtitle {
display:inline-block;
font-size: 30px;
}
.navbar-menu {
float:right;
}
.navbar-option {
display:inline-block;
font-size:25px;
padding:20px;
padding-left:30px;
padding-right:30px;
}
.navbar-checked {
background-color: rgb(0, 217, 63);
}
Put the element with that has "float: right" before the rest of the elements on that line.
Basically, move <div class="navbar-menu">...</div> before <img src="logo.png" ...>.
Or, in the sample code of the edited question, move <div class="navbar-menu">...</div> before <div class="navbar-title">...</div>.
I am not sure regarding the technical justification to this, but floats are better put before the non floats.
Perhaps this is because it assumes there is no room for the floating element.
Try elements on the left side wrapping with another div. Like this for example:
<div class="navbar-header">
<div class="another-div">
<img src="logo.png" alt="logo.png" class="navbar-logo" width="47" height="47">
<div class="navbar-title">
tick<span class="bookfont">talk</span>
</div>
<div class="navbar-subtitle">
social networking around the clock
</div>
</div>
<div class="navbar-menu">
<div class="navbar-option login-button">
Login
</div>
<div class="navbar-option navbar-checked signup-button">
Sign Up
</div>
</div>
</div>
Then give that .another-div CSS property float:left, and don't forget to set a hight for the .navbar-header after this.
.another-div{
float: left;
}
.navbar-header{
height: 80px;
}
This should work.