Can the following be achieved using HTML?
<a href="http://host.com/cat.png">text</a>
and in CSS:
a {
background-image: url(attr(href));
}
I have been trying but it doesn't seem to work for me. Is this even possible?
Can the following be achieved using HTML?
<a href="http://host.com/cat.png">text</a>
and in CSS:
a {
background-image: url(attr(href));
}
I have been trying but it doesn't seem to work for me. Is this even possible?
It is not achievable in a static CSS file, but you have the option to generate CSS dynamically using server-side languages like PHP.
Another alternative is to utilize Sass or LESS if variables are needed in your CSS.
I'm developing a JavaScript feature for creating status posts on a webpage. Within the "compose a post" div, there is centered text that reads "enter your text here" (using contenteditable). The issue I am facing is that when a new line is entered in ...
Currently, I am in the process of developing a slideshow using jQuery. My main struggle lies in creating a loop that will timeout the slideshow for a specific duration, say 10 minutes, before it reappears and resumes indefinitely. Unfortunately, my attempt ...
I've encountered a strange issue with my script where it seems to stack up borders and display a 2px border instead of the intended 1px border when switching elements on click. Here is the link code I am using: <li ><a href="plumbing.php"&g ...
Is there a way to use jQuery to slide down a div on page load when its CSS is set to display:none? I've come across various solutions, but none seem to work if the div is initially hidden. The challenge is finding a method that hides the div on load a ...
<div class="mt-3"> <mat-nav-list> <a mat-list-item class="ml-2" style="font-size:15px;" (click)='paycard.html'> SERVICES </a> <a mat-list-item class="ml-2" style="font-size:15px;" (click ...
I am looking to enhance the user experience on my website by changing the color of headings and images when a user hovers over a specific section. Currently, I have been able to achieve this effect individually for each element but not simultaneously. Any ...
Struggling to add a border while converting a PSD to HTML? Is it possible to apply a border to an image with a transparent background? For instance, let's consider the following image: Imagine wanting to place a border around the caret in the image l ...
(() => { const paraElement = document.querySelector('#animated-text'); const spanElement = paraElement.querySelector('span'); const wordsList = JSON.parse(spanElement.dataset.words); let counter = 0; setInterval(funct ...
Currently, I have a circle displaying text in the center as shown in this fiddle (JSFIDDLE http://jsfiddle.net/874jgh4v/2/). Now, my requirements are: I want to animate the outer white border based on a percentage. For example, if the percentage is 50% ...
Can we apply styling to text or paragraphs with styled-components? And if so, how can we insert text into the component? For instance, consider this Footer component: const Footer = () => ( <footer className="site-footer"> <p className= ...
Is there a way to only show the navigation bar when a user scrolls to the very top of the page? Currently, the nav bar appears whenever the user scrolls up, regardless of the screen position. Html <header class="nav-down"> <div> navigation ...
I have implemented the Bootstrap carousel on my website, but I am looking to customize its functionality. Specifically, I would like the slides to change whenever the user scrolls with their mouse. Is there a way to achieve this using Bootstrap Carousel? ...
I am experiencing an issue with two scrollbars in my HTML file. Scrollbar a is short, while scrollbar b is larger. When I scroll to the end of Scrollbar a, the focus shifts to Scrollbar b and it starts scrolling. Is there a way to prevent this from happeni ...
In my project, I've set up my custom.scss file with the following code: $primary: #e84c22; $theme-colors: ( primary: $primary, ); @import "~bootstrap/scss/bootstrap.scss"; Currently, the color looks like this: https://i.sstatic.net/lbL ...
My code looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Testing PasteHTML.co ...
Hey there, I'm a beginner to coding and I've been working on a little project to track the price of gold in a web application using Flask and Python. In my HTML code, I have a button that, when clicked, takes users to a new route where the gold ...
I'm having trouble retrieving the selected value from a dropdown menu as it always returns the first value. Initially, the dropdown is empty. When I press a button to open the modal and populate the dropdown with options, it seems that the issue aris ...
I am struggling to create a search match list that updates as the user types in their query. However, I am facing an issue where the input element loses focus to the pop-up. I have attempted to programmatically set the focus using refs, but I am unable to ...
Is it possible to create a Bootstrap 3 carousel where the image changes when the mouse cursor hovers over the thumbnail under the carousel? Currently, I have a setup with the carousel and thumbnails below it. Typically in Bootstrap, the image changes autom ...
I am facing an issue with the following expression: <td>{{student.name}}<br>{{student.age}}<br>{{student.fathername}}</td> When displayed, it looks like this: shane<br>26<br>greg Is there a way to break this into a ...