how to give a second css attribute an ::before element - html

Hey I'm using webflow to create my web project. Webflow gives active links an class called .w--current, that's their "active". So the link class looks like this when a webpage is open .nav__link .w--current.
How can I give in this specific case the .w--current element an ::before pseudo? I tried all kind of ways like .nav__link .w--current::before or .nav__link:before .w--current:before but none of them worked. Can I generally add an pseudo element to an CSS class which is at the second position?

The empty space between both classes was my problem.
The correct solution is: .nav__link.w--current:before

Related

How to custom style a button from a library?

I'm using a button from a library (https://www.npmjs.com/package/#react-oauth/google I understand this library has a custom button option but this option results in a different response).
I basically like to change the max-width and width to another value (image attached below). May I know is there a way for me to edit these style from CSS?
Thank you! Appreciate any help.
Google adds this button to the dom inside iframe, there are certain props you can style the button
to add with, check prop width on
it's mentioned on #react-oauth/google github README
https://developers.google.com/identity/gsi/web/reference/js-reference#width
So still new myself currently in a full stack boot camp in the react section. It should be possible.
Are you using a external stylesheet or trying to do it using inline?
I was taught to use a external stylesheet
From what I am seeing try changing class name to button.
class='button'
Then in your external stylesheet add
.button {
max-width: 400px;
}
Edit. I see you are using react... So it could be className='button'
Edit:
Hello, thanks for your reply! Hmm... in this case I am not able to
assign a className to div myself as the div is from the library. The
weird class you see above "nsm7Bb..." is not by me. Hence, I was
wondering if there's a way to forcefully override library class style.
– Olympian Collections
Gotcha.
Have you tried !important?
Is that your inline CSS?

Block popup on image hover using CSS

I want a popup block to appear when I hover over the image as given in the picture below. How can I achieve this using css.
I have already used css to change the background on hover so how can I make the content appear.
I have been using wordpress but I couldn't find any plugin for the same.
Can anyone help with this one?
Sorry, but you can't do this with only CSS : you have to use JS for it (so if you have not learned it before, I think you should...)
CSS can apply properties on elements "selected" but only that.
If you want to get an information about an element (like whether it is hovered) and apply a propertie to another element depending on the information (like visibility:hidden), you have to use JavaScript.

CSS property has been blocked

I've builded banner for my home page and I want to hide a few HTML element in the responsive mode. When I run it on chrome browser and then I got an issue. This is css property which has been blocked by another css class. I can't figure it out where this css class is ? Anybody can help me to give me solution?
I agree with Cheslab, I think this is inline style resulting from javascript.
css with a viewport property will show its source of the top right side of the style section in the console.
Try putting in any css file:
img.imgSGHN {display:none;}
If this doensn't make any changes, you should be able to override the inline style by adding "!important" (not recommended) in your custom style.
img.imgSGHN {display:none!important;}
will get rid of .imgSGHN element.
The best way to approach the problem would be finding the script where it creates the inline css style and changing its behavior. Simply making it not override "display: " property will do.

How to remove a link and replace it with message via CSS

I'm trying to remove a link completely via CSS and replace it with my own custom message. Is this possible? I found some link disabling via css but the anchor text is still visible, and doesn't allow me to include my own message.
Essentially I want to make it so only logged in members can view links, using a conditional that uses CSS only for non-logged in (guests) users, replacing download links with "Sorry, only members can see this link, register here"
Any ideas?
CSS would be a terrible way to add privacy to your element, as it could be seen in any case by inspecting the source code, or by just disabling CSS.
You have to hide your link server-side.
By the way, just for the sake of completeness, and in case you have to use such a thing for something that actually makes sense doing by CSS, you could go around doing it by adding a class to the html or body in case of non-authenticated users, and then having a CSS rule as such:
html.not-logged-in element {
display: none;
}
Keep in mind that, obviously anybody can still see the element if they want.
Edit
You can't change text with CSS (unless using the content property in a pseudo-element, but nevermind that, as you won't be able to change the href attribute of your link). So, to achieve what you are looking for, you need to have two separate elements. As I said above, add a class to your html or body when the user is authenticated (this is actually a good idea in general), then show and hide your elements conditionally.
So your HTML would look something like this:
<span class="error">Sorry, only members can see this link</span>
I am a secret link
And your CSS would look like this:
.not-logged-in .secret {
display: none;
}
.logged-in .error {
display: none;
}
You can see an example here. In this example I use Javascript to simulate your logging-in process (all I do in Javascript is really just adding the class to the html element).

An html box with a title and an edit button

I've made this html box, that is supposed to have a title and some buttons on right,
http://jsfiddle.net/vqpmt/17/
Everything seems fine except that the edit button as you can see is a little bit below the title, that shouldn't be the case they should both be at the same exact level.
How do I achieve that, and is my code a mess? Is there a better way of doing something like this?
I moved h1 and the edit link tag inside a div container. Check my version of your code here
To be on the exact same level, the html elements has to be either inside a container (as in my fiddle) or should use 2 inline html elements.
Try reading w3schools on html and css which has lot of information that you can learn in short time.
w3schools HTML reference here
w3schools CSS reference here
Edit: h1 is a block element which means it will add a new line. So I added a new css style .inline and changed the block property to inline.
.inline { display: inline }
Your H1 element extends the width of the page and is pushing your edit link down. I've provided an alternative solution here.
Fiddle: http://jsfiddle.net/GvGoldmedal/vqpmt/32/