fixed hidden footer showing though background - html

this is my first post here.
I've got a small problem with the website I'm working on at the moment.
Since I'm using a (css) parallax header I wanted to have a "special" footer as well.
The idea was to make it fixed to the bottom and let the body reveal the footer bottom first.
The problem is that my website is made up of multiple segments and the footer is visible in between them.
I tried to fix this by creating a background between the segments like this
.background {
color: #f1f1f1;
width: 100%;
height: 90%;
z-index: -2;
}
my footer looks like this
.footer {
padding: 40px 0;
text-align: center;
text-decoration: none;
background: black;
color: #white;
position: fixed;
bottom: 0;
width: 100%;
z-index: -1;
}
but whichever z-index I try, the footer is either completely in the background or in front of everything.
I don't really know what else I could try.
Here's my (shortend) HTML body (there's only the header and a navbar before that):
<div class="main">
<div class="row">
<div class="leftcolumn">
<div class="card">
<h1><?php echo $welcome1;?></h1>
<h5><?php echo $post;?></h5>
<p><?php echo $welcome2;?></p>
</div>
<div class="card">
<h2>Hiragana</h2>
<h5><?php echo $post;?></h5>
<img src="..//nihongo/pics/hiragana.png" width="650px" height="400px">
<p><?php echo $hira;?></p>
</div>
<div class="card">
<h2>Katakana</h2>
<h5><?php echo $post;?></h5>
<img src="..//nihongo/pics/katakana.png" width="650px" height="400px">
<p><?php echo $kata;?></p>
</div>
</div>
<div class="rightcolumn">
<?php include '../nihongo/php/language.php'; ?>
<div class="card">
<h2><?php echo $me1;?></h2>
<img src="../nihongo/pics/me.png" width="240px" height="322px" style="border: 1px solid black;border-radius:10px;">
<p><?php echo $me2;?></p>
</div>
<div class="card">
<h3><?php echo $use;?></h3>
<div class="fakeimg"><p>Hiragana</p></div><br/>
<div class="fakeimg"><p>Katakana</p></div><br/>
<div class="fakeimg"><p>Kanji</p></div><br/>
</div>
<?php include '../nihongo/php/follow.php';?>
</div>
</div>
</div>
<?php include '../nihongo/php/footer.php';?>
</body>
I'm using all those PHP variables because I'm running this website in multiple languages.
here is a screenshot of the issue without my "fix":
I can provide you more of my code if you want - just tell me what you want to see (I don't want to make this post too long right now).

You could define a white (?) background for .main and add a margin-bottom to .main whose value equals the height of the footer. That way the footer would only become visible after .main is scolled down all the way, in the space that is defined as its margin-bottom.

Related

Making whole "col-*" a link

Here's my HTML:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-sm-3">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-add.png'; ?>">
<p>User Add</p>
</div>
<div class="col-sm-3">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-edit.png'; ?>">
<p>User Edit</p>
</div>
<div class="col-sm-3">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-delete.png'; ?>">
<p>User Delete</p>
</div>
</div>
</div>
I'm looking to make the HTML like this:
<a href="#">
<div class="col-sm-3">
....
</div>
</a>
Where when the whole column is a link and when hovered over it changes opacity and is able to redirect to another page. However when i change my HTML my style sheet gets super messed up, and the alignment goes all haywire. (See second Code Pen)
https://codepen.io/JDSWebService/pen/BZpoaq
This is how I want it to look when all is said in done. Three evenly spaced column's with the correct widths.
Heres the Codepen of the issues i'm running into when i change my HTML code
https://codepen.io/JDSWebService/pen/bRgVVz
Help?
You can add 'onclick' instead of messing around with tag since that will screw up the bootstrap's col settings.
For example, <div class="col-sm-3" onclick="location.href='add.user.php';">
Please check out this Codepen. I was not able to test your links, but please let me know if this is what you are looking for.
https://codepen.io/pkshreeman/pen/awpvGy
You can put the a tag inside the col-3 and put all the rest of the content in it. Display the a tag as block, then move the padding code that is on the col-3 to the a tag. You can also move the background and border radius to be on the a tag as well. The col-3 should just be that, columns.
.row {
display: flex;
justify-content: center;
}
.col-sm-3 {
text-align: center;
margin: 0 2.5%;
}
.col-sm-3:hover {
opacity: 0.9;
}
.col-sm-3 a {
font-size: 1.5em;
color: white;
display:block;
padding: 2.5% 25px;
background: #303030;
border-radius: 25px;
}
.col-sm-3 a:hover {
text-decoration: none;
color: #00bc8c;
}
.img-sm {
width: 100px;
height: 100px;
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-sm-3"><a href="adduser.php">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-add.png'; ?>">
<p>User Add</p></a>
</div>
<div class="col-sm-3"><a href="edituser.php">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-edit.png'; ?>">
<p>User Edit</p></a>
</div>
<div class="col-sm-3"><a href="deleteuser.php">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-delete.png'; ?>">
<p>User Delete</p></a>
</div>
</div>
</div>
I havn't tried this out but I'm pretty sure that one way is to give your link a class like:
<div class="container">
<div class="row">
<a href="adduser.php" class="link">
<div class="col-sm-3">
<img class="img-sm" src="<?php echo Config::get('links/app_root') . 'assets/imgs/icons/user-add.png'; ?>">
<p>User Add</p>
</div>
</a>
and then something like:
.link {
height: 100%;
width: 100%
}
of course from there you can give the .link whatever properties you like. Might not be the best solution, but it is one solution I believe.
This can be easily done with jquery
give class name other than col-sm-3 for each div
make firstcol or col-sm-3 for all cursor: pointer;
$(".firstcol").click(function(){
window.location = "URL";
});

Insert link only to the div's background image and not to the other elements inside div

I would like to insert a link only to the background image of the div and not to the other elements, inserting the inline css !
This is my code:
<div class="col-sm-4 box-home" style="background-image: url('URL-IMAGE');">
<div id="spazio" style="height:55%;"></div>
<div class="description" id="descr-one">
<h2><?php the_field('titolo_il_box'); ?></h2>
<p><?php the_field('descrizione_il_box'); ?></p>
</div>
</div>
I want to add a link to the image of background.
If I add a tag in this mode, link all div !
<a href="URL">
<div class="col-sm-4 box-home" style="background-image: url('URL-IMAGE');">
<div id="spazio" style="height:55%;"></div>
<div class="description" id="descr-one">
<h2><?php the_field('titolo_il_box'); ?></h2>
<p><?php the_field('descrizione_il_box'); ?></p>
</div>
</div>
</a>
You can't add a link to background image only. You can only add links to elements, but not backgrounds.
You could possibly separate the image from background and place the text over it with position: absolute.
.box-home {
position: relative;
max-width: 500px;
display: flex;
align-items: center;
}
img {
max-width: 100%;
width: 100%;
}
.description {
background-color: #000;
color: #fff;
position: absolute;
text-align: center;
width: 100%;
}
<div class="box-home">
<img src="http://res.cloudinary.com/dzw929a4t/image/upload/v1495721050/sample.jpg" alt="" />
<div class="description" id="descr-one">
<h2>title</h2>
<p>description</p>
</div>
</div>
on CodePen: https://codepen.io/Klara/pen/oWVMJz
Note sure if this is what you want to achieve.
This way you target the image only, but I would not recommend separating the title and description from the link target as it might be confusing for the users. From UX perspective it makes more sense to have both the image and the text as one clickable link.

Need help for overflow-y:auto/ scrolling

I just create this div function:
<div class="row">
<div class="col-sm-12">
<!--<img src="images/article_image.png" class="img-responsive" />-->
<?php //echo $wordRow['article_image']; ?>
<h2 class="black_color" style="font-size: 25px; font-style:italic ;margin-left:15px">
<?php echo $wordRow['article_name']; ?>
</h2>
<div class="black_color" style="margin-left:20px; margin-right:20px; overflow-y:auto;">
<?php echo $wordRow['article_description']; ?>
</div>
</div>
</div>
which gives me this white form , which is part of this editor. By that I'm able to create articles on my site. Unfortunalety I get the scrolling on the side if the text is longer. I try do add
overflow-y:auto;
but that doesn't work. Putting a max length for the text doesn't work either. Basicly what I'm trying to do is to put a scrolling inside the white article form and not on the left of the page. Any ideas?
You can set two overflow properties, overflow-x and overflow y
Set the overflow-y to scroll and overflow-x to hidden on the same div and then it'll work just as well
If you give your divs ids and classes you can avoid inline-style and use css stylesheets (a lot easier!)
for example on the outer div you could give id of outer, and the inner div, inner. Your css/style section would look like this (example). Externally linked in stylesheets are preferred/recommended
#outer{height:100%}
#inner{width: 98%;
color:#000000;
overflow-y:scroll;
overflow-x:hidden;
margin-left: 20px;
margin-right:20px;
}
h2{color:#000000;
font-size: 25px;
font-style:italic ;
margin-left:15px}
This helps too:
#outer {
height: 100%
overflow: hidden;
}
#inner {
width: 98.5%;
position: fixed;
overflow:auto;
bottom:23px;
top: 137.5px;
}
<div id="outer">
<div id="inner">
<h2 class="black_color" style="font-size: 25px; font-style:italic ;margin-left:15px"><?php echo $wordRow['article_name']; ?></h2>
<div class="black_color" style="margin-left:20px; margin-right:20px;"><?php echo $wordRow['article_description']; ?></div>
</div>
</div>
Either way is good.
This helped me pretty much.
<div style="height:100%; overflow:hidden">
<div style="width:98.5%; position: fixed; bottom:23px; top: 137.5px; overflow:auto">
<h2 class="black_color" style="font-size: 25px; font-style:italic ;margin-left:15px"><?php echo $wordRow['article_name']; ?>
</h2>
<div class="black_color" style="margin-left:20px; margin-right:20px;">
<?php echo $wordRow['article_description']; ?>
</div>
</div>
</div>
I now get the scrolling inside the form, like this and the whole page stays in place. So will the text stay inside the the white form.

3 Column structure where the 2 outer columns are being dragged to the bottom of screen

I have a 3 col set up and when the page loads the two outer columns get pushed to the bottom of the screen. I can't move them using margins and believe it may be related to the center column which imports an external feed. I've spent hours on this with no resolution in sight. Any help would be extremely grateful for. webpage http://carrickswan.com/fix-test/
Sorry about the inline css it makes it look messy but hopefully someone can see the issue from the live page.
<!-- col 1 -->
<div style="background-color: white; width: 18%; margin: 25px 20px 0px 40px; display:inline-block;">
<div>
<h2 style="width: inherit; color: white; background-color: #2e2d2d; padding: 5px; background-image: url('http://carrickswan.com/wp-content/uploads/2016/04/header-bg2.png');
background-repeat: no-repeat;
background-position: right;" class="col-title">PLAY ONLINE</h2>
<img src="http://carrickswan.com/wp- content/uploads/2016/04/pay.jpg" alt="play swan lotto">
</div>
<div>
<h2>MEMBERSHIP</h2>
<img src="http://carrickswan.com/wp-content/uploads/2016/04/membership.jpg" alt="pay swan membership">
</div>
</div>
<!-- col 2 -->
<div id="content" style="background-color: white; width: 50%; display:inline-block; margin: 25px;">
<div id="content_fixtures"></div>
</div>
<!-- col 3 -->
<div style="width: 18%; display: inline-block; margin-top: 0px; background-color: white;">
<h2 class="title" style="color:white; background-color: #2e2d2d; padding: 5px; background-image: url('http://carrickswan.com/wp- content/uploads/2016/04/header-bg2.png'); background-repeat: no-repeat;
background-position: right;">LOTTO</h2>
<?php $cat_id = 7; //the certain category ID
$latest_cat_post = new WP_Query( array('posts_per_page' => 1, 'category__in' => array($cat_id)));
if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?>
<h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" ><?php the_title(); ?></a></h2>
<div style="padding:5px;">
<?php the_content($more_link_text,$strip_teaser); ?>
Read More
</div>
<?php endwhile; endif; ?>
</div>
Add vertical-align: top; to the two outer divs - I tried it on your page and it worked.
if you don't want to make them align top
here is the solution
wrap your 3 divs within container
<div class="main-container">
<div class="column one">
<div class="column two">
<div class="column three">
</div>
CSS
.main-container
{
display:flex;
}
.main-container .column
{
flex:1;
}

Create semi-transparent Image Overlay

I'm creating a one-page WordPress-theme. In each section there is a header with an image and an overlay.
The header has a background, within there is an image of a wrap-width. on bottom of that, there is a png-image which is semi-transparent and should be full-width, overlaying the header-image.
Since I'm using different styling for the sections, I'm numbering them and the overlay-image is in a different color for each section. So I should insert it through CSS.
Until now I just could make the overlay visible when I type in a height value. But since the page needs to be responsive, I want the height to be variable, and always 100% width.
My Code:
<?php query_posts('post_type=page&order=ASC'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="content" class=" section-<?php echo $i++; ?>">
<h2 class="headline"><?php the_field('headline') ?></h2>
<div class="header">
<div class="wrap cf">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail('bones-thumb-600');
}
else {
}
?>
</div>
<div class="overlay"></div>
</div>
<div id="inner-content" class="wrap cf">
<div id="main" class="m-all">
<div class="stripes"></div>
<!-- Thumbnail -->
<a class="logo" href="#top"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo.png" /></a>
<div class="sidebar">
<?php the_field('sidebar') ?>
</div>
<div class="main-content"><?php the_content(); ?></div>
<img src="<?php echo get_template_directory_uri(); ?>/library/images/separator.svg"/>
</div>
</div>
opacity: 0.5; should be what you search, 0.0 is transparent and 1.0 is visible, so 0.5 would be 50% visible
Please do like this
.image-holder{
height: 200px;
width:200px;
position: relative;
}
.image-holder:after{
content:'';
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
background: rgba(0,0,0,.3);
}
<div class="image-holder"><img src="images/img02.jpg" height="371" width="556" alt="image description"></div>