I guess I should start this off by saying that I'm working on a tumblr theme. This is what the link code looks like:
a {
color: {color:Text};
text-decoration: none;
padding: 3px;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px;
background: #C1FFC1;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
}
Now this code works perfectly fine; however, images that are links -- and just about every photo post IS a link -- show up with a green background, which is fine for text, but ugly for a picture.
I tried to use the following code to get rid of this:
a img {
border-width: 0px;
background: none;
}
This didn't work, however, and the background was still there.
If any of you want to check my theme out, here is a link to the blog: http://queenquagsire.tumblr.com (Just thought I should say, since this is not a professional website, and I'm only using it for testing purposes some -- well, all -- of the posts are pretty childish.)
The green background is kinda hard to see, but it's behind the center of image post, and sticks out. Also, when you hover over it, it disappears.
I feel like this is very simple, but I still can't seem to fix it; I've visited other websites and tried their solutions, but had no luck.
Also, I did try to change the link code to this
p a {
color: {color:Text};
text-decoration: none;
padding: 3px;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px;
background: #C1FFC1;
transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
}
so it only affected paragraphs, but that messed some other things up.
Can anyone help? Am I going to have to edit the link code itself?
CSS cannot look at an element’s children when deciding how to style that element. You’ll have to change the HTML part of your template to add a special class to image posts (say, image-post), and then style all a elements within one specially:
.image-post a {
background: none;
}
Historical note: An old draft of CSS3 from 2001 did specify a pseudo-class that could be used to select on an element’s content. However, all subsequent drafts have blanked that section out.
Related
I have a form that changes border color(red-green) if the inputted values are correct or not - I also change between two small icons (glyphicon-ok and glyphicon-remove) at the end of each field.
I wanted to add a transition effect on the border color and icons(ease-in-out).
On the border color works perfectly but I noticed on the icons even though I set 'ease-in-out' the very first transition it's still 'linear' - the icons come in from the bottom like something pushes them up - I want them just to simply appear with a 0.2s transition.
Here is my css for the icons:
.start-label .glyphicon-ok {
position: absolute;
font-size: 25px;
top: 19px;
right: 10px;
color: #ACCB71;
transition: 0.2s ease-in-out;
}
.start-label .glyphicon-remove {
position: absolute;
font-size: 25px;
top: 19px;
right: 10px;
color: #CC3E44;
transition: 0.2s ease-in-out;
}
I have only these transitions in my entire css code with the border ones.
The transition for the border is the following:
transition: border 0.2s ease-in-out;
What am I doing wrong here? Or this is how it supposed to work?
Thanks to Dorvalla's help I resolved it by specifying the transition on the color.
From:
transition: 0.2s ease-in-out;
To:
transition: color 0.2s ease-in-out;
I am trying to add transition, but can't make it work. My hover works slightly different, as it is targeting different class to change, it's:
.news-thumbnail:hover > .news-description-container{
padding: 1.5rem 2rem;
height: 21rem;
-webkit-transition: all 2s linear;
-moz-transition: all 2s linear;
-o-transition: all 2s linear;
transition: all 2s linear;
}
Edit: adding original class
.news-description-container{
position:absolute;
width: 100%;
bottom: 0;
border-bottom-right-radius: 1rem;
border-bottom-left-radius: 1rem;
background-color: white;
padding:2.5rem 2rem;
text-align: left;
height: 15.5rem;
}
Which makes this:
https://i.stack.imgur.com/DyeOS.png
Into this when you hover it(news-thumbnail), simply white area(news-description-container) slides up:
https://i.stack.imgur.com/Q6mxf.png
How can I make the transition work for this one? I just want it to slide up and down, not appear/disappear without transition.
Maybe I did it wrong and shouldn't do it this way?
Didn't found anything after googling, so it might be useful for others.
Thanks!
See Here... You can use same style hover transition.
Just change few parameters and thats it...
See code [Here]1
I'm getting this weird css bug. It almost seems like a caching issue or something with chrome as I can't replicate locally.
I send the user an invite and if they go to the invite page and then return to any other page that shows the banner, it's displayed wrong as one line of text is in times new roman.
The bug only happens if you've not been to the site before and you go to invite page then click back to any other page that has the banner.
2 things I've noted that are really unusual and I'm struggling to understand are:
The text that is displaying incorrectly is one word in an <a>
element, but parts of the text are fine.
When I open inspector and toggle any part of the css for the element.
It resets to how it should look immediately.
Here are some pictures:
How the banner looks
How it usually/should look
The <a> tag containing the button
As a sidenote I'm using chrome and rails 4 without turbolinks. Here is the code for the button:
.childminder-banner .btn {
padding: 3px 1em;
}
.btn-blue {
background: #34A9CD;
color: white;
}
.btn {
color: white;
-webkit-transition: none .1s ease-out 0s;
transition: none .1s ease-out 0s;
-webkit-transition-property: color,background,border;
transition-property: color,background,border;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
position: relative;
display: inline-block;
line-height: 1.5;
font-family: "Gordita";
font-weight: 500;
border-radius: 3px;
cursor: pointer;
text-align: center;
-webkit-transition: border-color .1s ease-out,background-color .1s ease-out,color .1s ease-out;
transition: border-color .1s ease-out,background-color .1s ease-out,color .1s ease-out;
background-color: #FF8027;
border-color: #FF8027;
}
Give style to the anchor tag display:inline-block
a{
display:inline-block;
}
At my blog -> http://studiodeideias.blog.br/
There is a "image caption" that I want to remove. Every time you pass the mouse on it, it gets darker (hoover effect).
Can anyone help? Thanks.
Assuming that what you want to remove is the hover effect, you should remove this lines of code from your style.css file
#feature-slider .entry-container:hover {
background: #444;
background: rgba(0,0,0,0.6);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
Once you do that, you're golden.
I'd like to ask if there is a solution for a little inconvenience I've encountered with a dashed links.
To save your time here is an example of my code, upon hovering specifically on a dashed line underneath an actual link it starts blinking immensely and it is not very aesthetically appealing. I'm fairly new into the css so I wonder if there is a mistake in my code.
p {
font-size: 35px;
}
a {
text-decoration: none;
color:#ff0089;
text-decoration: none;
border-bottom-color: #ff0089;
border-bottom-width: 2px;
border-bottom-style: dashed;
-o-transition:color .2s ease-out, background 1s ease-in;
-ms-transition:color .2s ease-out, background 1s ease-in;
-moz-transition:color .2s ease-out, background 1s ease-in;
-webkit-transition:color .2s ease-out, background 1s ease-in;
transition:color .2s ease-out, background 1s ease-in;
}
a:hover {
color:#eae327;
background: none;
border-bottom-style: none;
}
http://jsfiddle.net/j86ba/
Much obliged.
It happens because the border disappears on hover - turning of the hover functionality. So then the line reappears making in onHover again... (loop)
The solution I found was to set the color to white (or, whatever your background may be) instead of setting style to none. (I tried setting width to 0, but it had the same effect).
See fiddle
Seems hackish, but it works...
I would add that the probability of a user actually hovering exactly on the line (which triggers this behavior) is unlikely and probably shouldn't worry you. i.e. see comments on the question where people who were actually trying to make it happen couldn't reproduce the issue.
JNF's answer is good or you can hack by using this too in your anchor style :
display: inline-block;
height: 40px;