i'm trying to make a bit of a copy of this website but i'm having issues with the gallery part, my images simply won't behave the same as the website im attempt to copy. Obviously change around once complete.
Here is a JSFiddle of my code if that helps.
Here is my CSS for the section:
/* Gallery Start */
.box.style2 header {
display:inline-block;
background:#FFF;
padding:2em 3em;
margin:0px;
}
.box.style2 .inner {
position:relative;
padding:40px 0 0px 0;
}
.box.style2 {
text-align:center;
}
.box.style2 .inner:after {
content: '';
display:block;
position:absolute;
top:0;
left:50%;
height:100%;
border-left:solid 1px #FFF;
}
.box.style2 .inner .row {
position:relative;
}
.row {
border-bottom:solid 1px transparent;
box-sizing:border-box;
}
.row:after, .row:before {
content: '';
display:block;
clear:both;
height:0;
}
.row > * {
float:left;
}
.box.style2 .inner .image {
position:relative;
z-index:1;
padding:20px;
}
.image.fit {
display:block;
width:100%;
}
.gallery-image {
width:25%;
margin-left:0px;
}
/* Gallery END */
And here is my HTML:
<!-- Start of gallery -->
<article class="container box style2">
<header>
<h2>Recent Work</h2>
<p>Below are images of our recent completed work</p>
</header>
<div class="inner gallery">
<!-- Gallery Images -->
<div class="row">
<!-- Image -->
<div class="gallery-image">
<a href class="image fit" style="outline: 0px;">
<img src="images/01.jpg" />
</a>
</div>
<!-- Image END -->
<!-- Image -->
<div class="gallery-image">
<a href class="image fit" style="outline: 0px;">
<img src="images/01.jpg" />
</a>
</div>
<!-- Image END -->
<!-- Image -->
<div class="gallery-image">
<a href class="image fit" style="outline: 0px;">
<img src="images/01.jpg" />
</a>
</div>
<!-- Image END -->
<!-- Image -->
<div class="gallery-image">
<a href class="image fit" style="outline: 0px;">
<img src="images/01.jpg" />
</a>
</div>
<!-- Image END -->
</div>
</div>
<!-- Gallery Images END -->
</article>
<!-- End of gallery -->
Here is a screenshot of what my images look like, as you can see, they are not behaving at all.
I think this is because I don't have these styles, but I can't for the life of me figure out what they mean, all that I can understand from Google is that they are classes made from numbers:
.row.\30 \25 > * {
padding: 0px 0 0 0px;
}
/* Inherited from: #media screen and (max-width: 1680px}*/
.row > * {
padding: 40px 0 0 40px;
}
.\33 u, .\33 u\24 {
width: 25%;
clear: none;
margin-left: 0;
}
edit: so after readying wero's answer, am I understanding this properly?
.row.\30 \25 > * would basically target a class with the name 0 within the row class, and then the element within 30 with class 25 and then style the next element within that?
The \nn<space> syntax is a character escape sequence for the Unicode character U+00nn.
This article describes the topic very nicely.
Using the escape sequences they build valid CSS class identifiers.
Why do they do this? Can only speculate: For brevity, to generate unique names?
EDIT to answer the extended question:
.row.\30 \25 > * is a selector for all elements (*) whose parent element (>) has the CSS class row and the CSS class consisting of the two characters U+0030 and U+0025.
Related
I have a 'ul' with dynamic data. Each list inside has an user image, and when you hover on the image, an info box will show up on the left side of the 'ul'.
When I set the 'ul' to be overflow-y:scroll, the part of the info box that's outside of the 'ul' will be cut.
Here's what it should look like. The blue area is the info box.
Here's what it looks like now: The blue area is cut.
Here's the css code:
.popUpRSVPList{
padding-left:0px;
overflow-y: scroll;
height: 70%;
position: relative;
}
.hoverToShowInfo{
position: relative;
}
.hoverToShowInfo .infoinfo {
display: none;
}
.hoverToShowInfo:hover .infoinfo {
position:absolute;
left:-280px;
top: -60px;
display:block;
z-index: 10;
top: 100%;
}
Here is the html code:
<ul class="popUpRSVPList" >
<li style="padding-left:20px;">
<a class="hoverToShowInfo" href="">
<!--Left Info Box, will show on hover-->
<div class="col-sm-12 infoinfo" >
</a>
</li>
</ul>
UPDATE:
The reason I set overflow-y:scroll; is that I need the ul to be scrollable and thus when there are hundreds of data, the 'ul' list will be shorter than the screen, and user can just scroll inside it to view each list.
Here is a jsfiddle link: https://jsfiddle.net/7gr7jvvh/
Please uncomment overflow-y:scroll. You will see the difference.
Take a look at given jsfiddle code hope you want this thing:
.popUpRSVPList li { background: white; list-style-type:none; padding:12px 15px; color: black;}
.popUpRSVPList li:nth-child(odd) { background: rgba(241,242,242,1); }
.popUpRSVPList{
padding-left:0px;
/* overflow-y: scroll;*/
height: 70%;
position: relative;
}
.hoverToShowInfo{
position: relative;
}
.hoverToShowInfo .infoinfo {
display: none;
}
.infoinfo div{
width:270px;
}
.hoverToShowInfo:hover .infoinfo {
position:absolute;
left:0px;
top: -60px;
display:block;
z-index: 10;
top: 100%;
height: 100px;
overflow-y: scroll;
}
span.rightNames {
color: white;
}
.infoBoxFirstLine{
background:rgba(49,66,84,1);
min-height:auto;
max-width:270px;
padding:12px 15px;
}
<ul class="popUpRSVPList" >
<li style="padding-left:20px;">
<a class="hoverToShowInfo" href="">
&User Name
<!--Left Info Box, will show on hover-->
<div class="col-sm-12 infoinfo" >
<div class="infoBoxFirstLine row " >
<!--attendee profile image w-->
<div class="leftImage" >
<img src="" style="border-radius:150px; width:50px; height:50px;"/>
<!--attendee name w-->
<span class="rightNames" style="">
NAME 1
</span>
</div>
<!--end-->
</div>
<div class="infoBoxFirstLine row " >
<!--attendee profile image w-->
<div class="leftImage" >
<img src="" style="border-radius:150px; width:50px; height:50px;"/>
<!--attendee name w-->
<span class="rightNames" style="">
NAME 1
</span>
</div>
<!--end-->
</div>
<div class="infoBoxFirstLine row " >
<!--attendee profile image w-->
<div class="leftImage" >
<img src="" style="border-radius:150px; width:50px; height:50px;"/>
<!--attendee name w-->
<span class="rightNames" style="">
NAME 1
</span>
</div>
<!--end-->
</div>
</div>
</a>
</li>
</ul>
I have an image and I'm looking at basic customisation for a small website I'm creating in HTML.
I understand you can chamfer an image, as seen on this question here, that gives a 45Degree cut.
I'm hoping for a more rounded Chamfer on each corner? (I believe it's called a Fillet but I'm not 100% sure of the correct terminology.
As seen in the second picture:
Using border-radius: 16px 16px 16px 16px; works by putting it in the img class, but I don't want all images affected.
What do I need to do to allow only select images to be chamfered?
I tried this, but it didn't work:
.img-chamfer {
border-radius: 16px 16px 16px 16px;
}
<div class="img-chamfer">
<img src="Test.png" >
</div>
My exact code can be found here: https://jsfiddle.net/netazv40/
.main {
color:#29abe2;
text-align: center
}
.img-wrapper {
display: inline-block;
}
.img-wrapperPadding {
display: block;
margin: 0 auto 32px;
}
img {
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}
<div class="main">
<div class="img-wrapper">
<div class="img-wrapperPadding">
<img src="http://placehold.it/350x208" width="350" height="208"><br/>
<img src="http://placehold.it/100x50" width="100" height="50">
</div>
</div>
<div class="img-wrapper">
<div class="img-wrapperPadding">
<img src="http://placehold.it/350x208" width="350" height="208"><br/>
<img src="http://placehold.it/100x50" width="100" height="50">
</div>
</div>
</div>
I only need the larger image to be affected/chamfered.
solution after providing your fiddle
You can use the following CSS rule:
.img-wrapperPadding img[width="350"] {
border-radius:16px;
}
Demo: https://jsfiddle.net/netazv40/3/
... or add a class to your image and solve it like the following:
.rborder {
border-radius:16px;
}
<img class="rborder" src="http://placehold.it/100x100"/>
Demo: https://jsfiddle.net/netazv40/1/
solution #1 (using flexbox):
.img-chamfer {
border-radius:16px;
display:inline-flex;
overflow:hidden;
}
<div class="img-chamfer">
<img src="http://placehold.it/100x100">
</div>
solution #2 (using inline-block):
.img-chamfer {
border-radius:16px;
display :inline-block;
overflow:hidden;
font-size:0;
}
<div class="img-chamfer">
<img src="http://placehold.it/100x100">
</div>
You can use border-radius like,
div {
border: 3px solid;
border-radius: 30px;
}
I am trying to add social media buttons to my WordPress page via HTML code:
However, they styling does not work, they take up the entire page and are much too big. Why does this happen, and can I fix it?
Here is the code:
<style type="text/css">
#share-buttons img {
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
}
</style>
<div id="share-buttons">
<!-- Facebook -->
<a href="http://www.facebook.com/sharer.php?u=http://www.jusskaur.com/blog/workshop-with-senior-ladies/" target="_blank">
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/facebook.png" width="35" height="35" alt="Facebook" />
</a>
<!-- Twitter -->
<a href="https://twitter.com/share?url=http://www.jusskaur.com/blog/workshop-with-senior-ladies/&text=Simple%20Share%20Buttons&hashtags=simplesharebuttons" target="_blank">
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/twitter.png" alt="Twitter" />
</a>
<!-- Google+ -->
<a href="https://plus.google.com/share?url=http://www.jusskaur.com/blog/workshop-with-senior-ladies/" target="_blank">
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/google.png" alt="Google" />
</a>
<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?mini=true&url=http://www.jusskaur.com/blog/workshop-with-senior-ladies/" target="_blank">
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/linkedin.png" alt="LinkedIn" />
</a>
<!-- Pinterest -->
<a>
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/pinterest.png" alt="Pinterest" />
</a>
<!-- Email -->
<a href="mailto:?Subject=Simple Share Buttons&Body=I%20saw%20this%20and%20thought%20of%20you!%20 https://simplesharebuttons.com">
<img src="http://www.jusskaur.com/wp-content/uploads/2016/06/email.png" alt="Email" />
</a>
</div>
When a style is being overwritten by another style, the best fix is to use a stronger selector:
#share-buttons a img { /* added 'a' */
width: 35px;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
}
For a more in-depth explanation of CSS specificity, read this CSS Tricks article.
instead, define a specific size for the 'a' tags and set the images to be 100% width.
#share-buttons a { width:35px, display:inline-block}
#share-buttons a img {width: 100%}
also, remove the width parameter in the 'a' tags
Add this,
#share-buttons {
width: 100%;
height:auto;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline;
}
#share-buttons > a{
text-decoration:none;
}
#share-buttons > a > img{
width:35px;
height:35px;
}
#share-buttons img {
max-width: 100%;
height: auto;
}
#share-buttons a {
width: 35px !important;
padding: 5px;
border: 0;
box-shadow: 0;
display: inline-block;
}
I want to click only on left side where is letter "F" and other section to make not clickable. I am trying with css class diver but not work.
Html
<a href="https://www.google.com" class="diver" target="_blank">
<div style="margin-top:0px;">
<img src="http://www.upslike.net/imgdb/facebook-4846a5.png" width="30%" height="60px">
</div>
</a>
CSS
<style>
.diver a{
display:block;
width:100px;
height:60px;
}
</style>
CodePen
If the image must be in the HTML.
Note: The "universal reset" (the * section) have an effect on elements outside the scope of the current question. Headers, paragraphs and lists spring to mind.
* {
margin: 0;
padding: 0;
}
.diver-wrap {
display: inline-block;
position: relative;
margin: 1em;
}
a.diver {
position: absolute;
top:0;
left: 0;
width:100px;
height:60px;
background: rgba(0,0,0,.25); /* for visual reference */
}
<div class="diver-wrap">
<img src="http://www.upslike.net/imgdb/facebook-4846a5.png" alt=""/>
</div>
Having problems displaying two images and one h1 tag on the same line. I want to align one image to the left and the last two elements on the right. Any tips on how to do that?
HTML
<div class="header">
<img src="meny_knapp2.png" class="meny" alt="meny link">
<img class="hioa" src="logo_hvit.png" alt="HiOA logo">
<h1 class="lsb"> Læringssenteret </h1>
</div>
CSS
.header {
height:120px;
width:100%;
background-color:#ff7f1f;
color:white;
font-size:20px;
display: table;
vertical-align:middle;
}
.meny {
height: 25px;
margin-left:0.5em;
line-height:120px;
}
.lsb {
font-size:24px;
letter-spacing:0.09em;
font-weight:lighter;
display:inline;
}
.hioa {
height: 60px;
float:right;
margin-right:1em;
}
.header * {
float: right;
}
.header img:first-child {
float: left;
}
.hioa {
height: 60px;
margin-right:1em;
}
please adjust css in class
<div class="header">
<div style="float:left;width:30%">
<img src="meny_knapp2.png" class="meny" alt="meny link" width="50"/>
</div>
<div style="float:right;width:70%">
<img class="hioa" src="logo_hvit.png" alt="HiOA logo" style="float:left;width:100px"/>
<h1 class="lsb" style="float:left;width:50%"> Læringssenteret </h1>
</div>
</div>