Readding a link to a Page Logo using CSS - css

I've installed the Social Fixer plug-in to tinker with the CSS of Facebook. I've been doing a decent job and playing with the overall look of it except for one little detail that's been bothering me
I've reached the point where I've decided to change the Facebook logo to a gif I got online and modified. The change is made no problem except that clicking on the logo no longer takes you back to the Facebook homepage.
The change I made is the following:
#pageLogo
{
content: url('http://i.imgur.com/hrsJAJh.gif');
height: 82%;
width: auto;
position: relative;
left: -35px;
}
I've tried using background-image: url(...);, but it just puts my new logo behind Facebook's official logo. I realize that using content: url(...); is also changing (i.e. removing) the anchor to the homepage found in:
<h1 id="pageLogo">
<a data-gt="{"chrome_nav_item":"logo_chrome"}" href="https://www.facebook.com/?ref=logo">Facebook</a>
</h1>
I've tried changing the content of the anchor itself to add the link back to the homepage:
#pageLogo a
{
background-color: transparent;
content: url('http://www.facebook.com/');
}
#pageLogo a:link
{
background-color: transparent;
content: url('http://www.facebook.com/');
}
#pageLogo a:visited
{
background-color: transparent;
content: url('http://www.facebook.com/');
}
#pageLogo a:active
{
background-color: transparent;
content: url('http://www.facebook.com/');
}
#pageLogo a:hover
{
background-color: transparent;
content: url('http://www.facebook.com/');
}
But it doesn't work and I'm guessing that's because I'm changing the content of the anchor (i.e. the "Facebook" text) and not the actual "href" of that anchor.
I've looked here for anyone with a similar problem and most answers said to modify the HTML or use Javascript instead. With Social Fixer, I am only able to modify the CSS.
I've checked w3 for an attribute for "href" and "data-gt" just in case, but no luck.
Just to reiterate after all this text, I want to change Facebook's logo while keeping the link to the Facebook homepage only using CSS.

The Facebook logo is, at the time of this answer, a background-image of the a link inside the h1#pageLogo, not the background of the element itself. This is why your attempt at changing the background-image resulted in an image behind the logo.
You'd want to change the background-image of the link. Something like:
#pageLogo a {
background-image: url('http://i.imgur.com/hrsJAJh.gif');
background-position: top left; /* probably */
height: "your image height";
width: "your image width";
}

Related

Change size of an image appearing by hovering over text css

I have a text on which when you hover (or when you click on it on mobile), a picture appear. I used this stackoverflow answer to make it work.
I'm now trying to make the picture change size automatically, so the picture fit both on mobile and computer.
a.hovertext1:after {
content: 'Text that appears before I hover.';
}
a.hovertext1:hover:after,
a.hovertext1:focus:after {
content: url(https://cdn.discordapp.com/attachments/1074330512925143102/1076897722075971675/5226579-le-drapeau-national-de-la-republique-federative-du-bresil-fond-d-ecran-du-drapeau-bresilien-avec-des-styles-de-degrade-d-ombre-gratuit-vectoriel.jpg);
display: block;
}
<a name="return1" id="return1"></a>
I know I need to add width:100%; somewhere in my code, but I have no idea where. I tried putting it in the a.hovertext1:focus:after{...} block, but it didn't do anything.
Hope someone can help me!
Is there any reason for which you want to use pseudo elements ? There is a different approach using simple display property on hover.
img {
display: none;
width: 100%;
}
a:hover + img {
display: block;
}
a:hover {
display: none;
}
Text that appears before I hover
<img class="img" src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80" />
Also I suggest to use buttons instead of links. Buttons are used for actions that affect the website’s front-end; links are used for navigation and actions that don’t affect the website.

Changing Background of One Page on Squarespace

I am trying to change the background on the Blog page of my website. The current website is all black backgrounds, but I would like the Blog page to be white with black text. I need to have my own CSS as Squarespace does not support this as a custom setting.
I have already tried codes provided for things like this, but nothing has worked. For instance: https://answers.squarespace.com/questions/14800/how-can-i-change-the-content-background-color-on-only-one-page-using-css.html
#main { background-color: #ffffff; }
I would like the background color to change.
You may target the blog specifically via its collection ID, which Squarespace adds as a class for you, on the body element. From there, we must target the div that is its immediate child, .overflow-wrapper.
Insert the following CSS via the CSS Editor:
.collection-5d0a3c81de1f2b00012ccccc .overflow-wrapper {
background-color: white;
}
Because the text is white, it will appear invisible. You should be able to adjust the titles and other meta-information (author, date, tags, categories, etc.) using the Style Editor.
However, I don't believe the style editor will give you an option to alter the body text (p elements) on the blog separately from the rest of the site. Therefore you may also find the following CSS helpful for changing body text on blog pages to black:
.collection-5d0a3c81de1f2b00012ccccc p {
color: black;
}
In addition, you may need to add some CSS to address the header, which as a result of setting a white background will be unreadable.
.collection-5d0a3c81de1f2b00012ccccc.site-spacing-small .site-header, .site-spacing-small .site-page, .site-spacing-small .site-footer {
margin-top: 0;
margin-bottom: 0;
padding-top: 3vw;
padding-bottom: 3vw;
}
.collection-5d0a3c81de1f2b00012ccccc #header {
background-color: black;
}
And finally, the page title should also be set to black:
.collection-5d0a3c81de1f2b00012ccccc .page-text-wrapper .page-title {
color: black;
}

Display text as well as icon in Woocommerce handheld menu

There is great documentation on how to change or remove the handheld menu links in WooCommerce available. However, I have noticed that many mobile designs (mweb and apps) are trending towards showing text as well as icons for handheld menus. I want to display the text for the link UNDERNEATH the icon, as well as the icon itself.
It looks like WooCommerce has intentionally hidden the text for the handheld link using CSS:
.storefront-handheld-footer-bar ul li>a {
height: 4.235801032em;
display: block;
position: relative;
text-indent: -9999px;
z-index: 999;
border-right: 1px solid rgba(255, 255, 255, .2)
}
My suspicion is that I should just change the text-indent and the text will show back up. For example, in the instructions provided by WooCommerce to add a new home link to the handheld menu, my thought was that changing text-indent in the CSS would allow me to display both the icon and 'Home'.
function jk_home_link() {
echo '' . __( 'Home' ) . '';
}
But, I can't quite figure out how to "undo" the text-indent so that the text for the link shows as well. Any thoughts?
The text is hidden due to "text-indent: -9999px;" so you can change it as follows.
Here I am additionally added "line-height:" to arrange position of the text.
.storefront-handheld-footer-bar ul li > a {
text-indent: 0px;
line-height: 95px;
}
If you need to adjust position of the icons, you can add following css and make changes on the value.
.storefront-handheld-footer-bar ul li>a::before {
line-height: 2;
}

Using WP web scraper with WordPress

I'm trying to use WP Web Scraper plugin with WP in my site www.eastwickpark.co.uk to get online ratings of the practice from another site
https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice
I used this code snippet
<img src="http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/iwantgreatcarelogo.png" />
<div>
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".image-middle" basehref="1" ]
</div>
Then I used custom CSS in the themes stylesheet editor
.btn.blue,
div .btn.blue {
font-size: 16px;
padding: 8px 16px;
}
/*** Stars ***/
.sprite-icons.star-blue-outline {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue-outline.png');
width: 19px;
height: 17px;
}
.sprite-icons.star-blue-fill {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue.png');
width: 19px;
height: 17px;
}
.sprite-icons.star-blue-half {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/star-blue-half.png');
width: 19px;
height: 17px;
}
.sprite-icons.caret-white {
background-image: url('http://www.eastwickpark.co.uk/wp/wp-content/uploads/2015/11/caret-white.png');
width: 10px;
height: 14px;
}
I've got a problem with my CSS in that the button "wraps".
Tried to just get the star rating targeting the class "raty-rating-wrapper-readonly" part but then I get a whole load of vertical stars.
i.e. if i use
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".raty-rating-wrapper-readonly" basehref="1" ]
I get a whole vertical list of 5 * images?
If I use image-middle div like this
[wpws url="https://www.iwantgreatcare.org/gpsurgeries/eastwick-park-medical-practice" query=".image-middle" basehref="1" ]
I get a weird wrap on the button.
Can't figure this out, and have to admit I'm not a CSS guru. Any insight would be gratefully received.
I've got a problem with my CSS in that the button "wraps"
The cause of the wrapping behaviour is due to <br> tag dynamically generated by WordPress. You can either fix it by following the guideline here: Stop WordPress automatically adding <br> tags to post content
The above post is a plus for you because it also removes the <p> tags that are dynamically generated. I just browsed through your code and found a lot of unwanted p tags.
Can't figure this out, and have to admit I'm not a CSS guru. Any
insight would be gratefully received.
Since you hinted for a CSS solution, a simple fix is to hide the br tags using #widgets .textwidget br { display: none; }. Alternatively #widgets .textwidget a { display: inline-flex; align-items: center } fixes the space and aligns the arrow image as the br tag is ignored inside and initial direction of flex is row.
Unwrapped button:

How to change the Home icon in Primefaces Breadcrumb?

I would like to change the home icon of the Primefaces Breadcrumb with another icon but I can't find how.
I tried with CSS but it is not working for the icon:
.ui-breadcrumb {
background: none !important;
border: none !important;
icon: url('resources/images/look/bandeau.png')
}
It should be enough with:
.ui-breadcrumb .ui-icon-home {
background-image: url("#{resource['images/look/bandeau.png']}");
background-position: 0; /* asuming bandeau.png is a single image */
}
But you have to make sure two things:
First, that you are overriding primefaces css correctly, you shouldn't need !important. See this. If you are doing it right, at least you will see that the default image dissapear.
Second, you have to make sure that you are referring to the image correctly. In my code, I show how I do it myself, but it depends on your configuration so you should also check this.
Try to target that specific icon by doing so:
.ui-breadcrumb ul li .ui-menuitem-link.ui-home {
background: none !important;
border: none !important;
background-image: url('resources/images/look/bandeau.png') !important;
}
Also check if the background image hyperlink is correct.

Resources