picture on the bottom right cornor of image - html

I am trying to get a little icon on the right bottom corner of the image. So the image gets a little icon on the bottom right cornor of the picture.
<div>
<div class="tab-pane" id="activity">
<div class="post clearfix">
<?php
$suppport = $app->get_supportpage();
foreach($suppport as $support){
?>
<div class="user-block" style="margin-top:5px;">
<img style="margin-top:3%;"class="img-circle" src="/assets/images/profielfotos/64hond.jpg">
<span class="username"><?php echo $support['van_naam'] ?></span>
<span class="description">
<div style=" white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px;">
<b><?php echo $support['bericht']; ?></b><br>
31 minuten geleden<p style="float:right;"><?php echo $support['type']; ?></p></div>
</span>
</div><hr>
<?php } ?>
</div>
</div>
</div>

use div instead of img tags, and use a background-image:url('path') for your images and do a position:absolute on your icon
.image{
width:100px;
height:100px;
position:relative;
background-color:lime;
background-image: url(//www.w3schools.com/Html/pic_trulli.jpg);
background-size: cover;
}
.image .icon i{
position:absolute;
bottom:0px;
right:0px;
font-size: 33px;
color: blue;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="image">
<div class="icon"><i class="fa fa-car"></i></div>
</div>

Related

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;
}

Hover on div element does not do the effect individually

I have multiple divs with the same class of "product". When I hover on each product element, I need them to have a hover effect, but the problem is that when I hover over the first element, all other elements also have the effect applied rather than just the one i hovered. What am i doing wrong?
<style>
div.product{
width:90%;
margin:10px auto;
height: 200px;
transition: all 0.1s ease;
background-color: #069;
}
div.product:hover{
margin-top:-5px;
}
.img_box{
width:50%;
height:100%;
padding: 10px;
float:left;
box-sizing: border-box;
}
.desc_box{
width:50%;
height:100%;
float:left;
padding: 10px;
box-sizing: border-box;
}
.img{
background-color: #b65050;
height: 100%;
}
.desc{
background-color: chocolate;
height: 100%;
}
</style>
HTML:
<div>
<div class="product">
<div class="img_box">
<div class="img">
image
</div>
</div>
<div class="desc_box">
<div class="desc">
desc
</div>
</div>
</div>
<div class="product">
<div class="img_box">
<div class="img">
image
</div>
</div>
<div class="desc_box">
<div class="desc">
desc
</div>
</div>
</div>
<div class="product">
<div class="img_box">
<div class="img">
image
</div>
</div>
<div class="desc_box">
<div class="desc">
desc
</div>
</div>
</div>
<div class="product">
<div class="img_box">
<div class="img">
image
</div>
</div>
<div class="desc_box">
<div class="desc">
desc
</div>
</div>
</div>
</div>
heres my fiddle: MY FIDDLE
This is because you are floating the divs. Changing margin-top moves the element which creates room underneath it.
What you need is this:
div.product{
position:relative;
}
div.product:hover{
top:-5px;
}
position:relative basically takes up the original space but lets the div to be rendered elsewhere.

Images Overlap when window size decreases

Thanks for all of your help on my previous question! However, I noticed a small issue- It's not too important, I just wanted to know if there's a way to fix it. As the browser window gets smaller, the images start to overlap. I'd like the images to stop when they're 5px away from each other.
Could someone look over my code and make sure I'm not doing anything wrong with my HTML/CSS?
The HTML is this:
<div class="content">
<div class="listingThumbLine">
<div class="modelListing left">
<a href="modelOne.html">
<img src="modelOne.jpg" alt="Model One" class="modelThumb" id="modelOneThumb">
</a>
<br />
<span class="productThumbName">Model Name</span>
</div>
<div class="modelListing right">
<a href="modelTwo.html">
<img src="modelTwo.jpg" alt="Model Two" class="modelThumb" id="modelTwoThumb">
</a>
<br />
<span class="productThumbName">Model Name</span>
</div>
<div class="modelListing center">
<a href="modelThree.html">
<img src="modelThree.jpg" alt="Model Three" class="modelThumb" id="modelThreeThumb">
</a>
<br />
<span class="productThumbName">Model Name</span>
</div>
</div>
</div>
The CSS is this:
body{
background-image:url('bg.jpg');
background-repeat:repeat-x;
font-family: Arial;
color:#B5B5B5;
text-align:center;
}
.content{
font-size:1.25em;
margin:10px 100px;
}
img.modelThumb{
width:225px;
height:225px;
}
.left{
float:left;
position:relative;
}
.right{
float:left;
position:relative;
}
.center{
float:left;
margin: 0 auto;
}
.modelListing{
width: 33%;
text-align: center;
}

html, div, and floating structure

What is the correct way to structure (html) on a page based on the image I have attached. I am trying but I keep getting overflow issues with the name for the second section appearing directly under the text section instead of on top of the photo. I have built my structure like this:
<div style="width:100%; padding-bottom:30px;">
<strong>Name1</strong>
<div style="float:left; padding-right:30px; width:20%">
PHOTO
</div>
<div style="float:left; width:70%">
TEXT SECTION
</div>
</div>
<div style="width:100%; padding-bottom:30px;">
<strong>Name2</strong>
<div style="float:left; padding-right:30px; width:20%">
PHOTO
</div>
<div style="float:left; width:70%">
TEXT SECTION
</div>
</div>
Move you <strong> outside the <div>-s and apply overflow: hidden to <div>s
.panel { width:100%; padding-bottom:30px; overflow: hidden }
.photo { float:left; padding-right:30px; width:20%; height: 80px; border: 3px solid #000 }
.text { float:right; width:70%; height: 80px; border: 3px solid #000 }
<strong>Name1</strong>
<div class="panel">
<div class="photo">
PHOTO
</div>
<div class="text">
TEXT SECTION
</div>
</div>
<strong>Name1</strong>
<div class="panel">
<div class="photo">
PHOTO
</div>
<div class="text">
TEXT SECTION
</div>
</div>
<strong>Name1</strong>
<div class="panel">
<div class="photo">
PHOTO
</div>
<div class="text">
TEXT SECTION
</div>
</div>
HTML
<div class="pick_group">
<h2>Name 1</h2>
<img class="photo" />
<p class="text"></p>
</div>
<div class="pick_group">
<h2>Name 2</h2>
<img class="photo" />
<p class="text"></p>
</div>
The CSS
place this in between just before the
.pick_group {
width: 800px;
margin: 0 auto;
clear: both;
}
.pick_group h2{
style if you want
}
.photo {
width: 200px;
float: left;
margin: 10px 25px;
}
.text {
width: 500px;
float: left;
margin: 10px 25px;
}