Dynamic Connection

I'm having trouble with this code not resizing correctly when the screen size is reduced. Please note that this link will be placed on top of an image.

<!--HTML-->
<div class="link">
    <a class="learn_more" href="link_here">Learn More</a>
</div>

/*css*/
 a.learn_more {
    width: 100%;
    max-width: 131px;
    text-align: center;
    font-size: 17px;
    border-radius: 10px;
    position: absolute;
    transform: translate(60%, 430%);
    text-decoration: none;
    display: inline;
    padding-top: 8px;
    padding-bottom: 11px;
    color: white;
    background: #75c1de;
    border: white;
    border-style: solid;
  }

a.learn_more:hover {
    text-decoration: none;
    color: #75c1de;
    background: white;
    border: #75c1de;
    border-style: solid;
    transition-duration: 0.5s;
}

Answer №1

To make your website responsive, you can use a media query. Simply run the snippet and view the page in 'full page' mode, then scale the browser width below 600px.

a.learn_more {
  width: 100%;
  max-width: 131px;
  text-align: center;
  font-size: 17px;
  border-radius: 10px;
  position: absolute;
  transform: translate(60%, 430%);
  text-decoration: none;
  display: inline;
  padding-top: 8px;
  padding-bottom: 11px;
  color: white;
  background: #75c1de;
  border: white;
  border-style: solid;
}

a.learn_more:hover {
  text-decoration: none;
  color: #75c1de;
  background: white;
  border: #75c1de;
  border-style: solid;
  transition-duration: 0.5s;
}

@media only screen and (max-width: 600px) {
  a.learn_more {
    /* Add your mobile styling here */
    max-width: 80px;
    font-size: 12px;
    padding: 3px 6px;
  }
}
<div class="link">
  <a class="learn_more" href="link_here">Learn More</a>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Prevent bouncing effect in Cordova/Phonegap specifically for the header and footer sections

I've utilized the property in the config.xml file to prevent bouncing in the webview (iOS): <preference name="DisallowOverscroll" value="true" /> It's working as intended. However, I'm wondering if there's a way to disable bounc ...

Instructions on how to properly align a Youtube video using the react-youtube package

I'm currently encountering an issue with my YouTube video display. I have managed to make it responsive, but it is stuck on the left side of the screen and I am unsure how to center it properly. I tried adjusting the padding, but it didn't work a ...

I am having issues with my Django application where I am unable to check

I have an HTML page where I want to only display the search bar if the table object passed in is not empty. However, my check doesn't seem to be working correctly. Here's my code: <!-- We'll show the search bar only if the user has acces ...

Issues with redirecting with .htaccess in Angular HTML5 site are currently unresolved

Here is the content of my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(.*) /index.html [NC, ...

Maintain scroll position when updating the DOM in Vue.js

Currently, I am working on a chat application that loads recent chat messages and stores them in an array called messages. As users scroll through the history, previous chat messages are loaded and added to the beginning of the messages array. One challeng ...

How can I dynamically populate a select menu in HTML without the need to submit any data

Looking for help with an input form in HTML that uses a combination of input and select boxes. My goal is to dynamically populate a select menu based on the data entered into the input boxes. For example: Employee One: Jim Employee Two: John Employee Thre ...

Nginx and Django encountering issues with loading css files on a production server

I've come across several similar posts, but none of the solutions seem to work for me. Every time I load my static files, the browser throws errors like these: When I collect static files, everything works fine. Even running findstatic points me to t ...

What is the best way to postpone one of the 3 ajax requests?

Can anyone assist me with handling AJAX forms? I am trying to ensure that the smallest one is executed after the others, but I also want to introduce a delay in the process. I attempted to utilize setTimeout(), however, it does not seem to be functioning ...

What is the best way to turn off autocorrect in a textarea on IE11 without turning off spellcheck?

In my experience, disabling the spellcheck attribute seems to solve the auto-correct issue, but it also eliminates the underlining of misspelled words. <textarea id="TextArea1" spellcheck="false"></textarea> I prefer to keep spellcheck enabl ...

Stylesheets are being requested over the network, however, they are not being applied to the HTML

https://i.sstatic.net/GGYxm.png The screenshot above shows the initial setup in Firefox's developer tools. There is a <link rel="stylesheet"> in the header, but no styles are applied to the <body> element in the lower viewport. The second ...

Forming a ring around a character within a header one element

I am faced with the challenge of only circling a single letter within a word that is contained in an H1 tag. While creating a circle around text is easy, I specifically need to target just one letter: .large { font-size: 5em; } .circle { border-rad ...

Steps to altering the color of a second button with a button click

My goal is to create a button click function that allows only one button to be clicked at a time. For instance, when btn1 is clicked, its background color changes from transparent to green. Then, if btn2 is clicked, btn1's background color should chan ...

a guide on determining the status of HTML5 Application Cache using Selenium and Java

How can I retrieve the status of HTML5 Application Cache using Selenium and Java? In my Selenium/Java programming project, I am trying to get the status of the HTML5 Application cache. However, the code below is not working as expected. It throws an error ...

Having trouble with HTML code displaying correctly in R leaflet for labels instead of popups

While working with leaflet in R Studio, I encountered an issue when trying to add HTML code to the labels of the icons. Strangely enough, it works for the popups but not for the labels. Below is the code snippet causing the problem: library(leaflet) libr ...

Retrieving HTML source code using PyGTK WebKit

Can anyone help me with this issue I am facing in my code? When I try to get the HTML source code of the current page, all I get is 'GString at 0x8875130'. How can I convert this into actual text that contains HTML? import gi gi.require_version( ...

Manipulating the size of one div automatically adjusts the size of the other, as they are

I have encountered an issue while trying to manage two resizable divs. I am looking for a solution where changing the size of one div will automatically adjust the size of the other div along the grid, and vice versa. Currently, I am only able to achieve ...

Dynamic parallax or stacked vertical text animation

I am attempting to replicate the text effect found on . The text is centered both vertically and horizontally within each div, but as you scroll down, the top position shifts creating a parallax effect. As you continue scrolling, the text transitions to th ...

Converting an HTML table into a visual image

I've encountered an issue. My task involves transferring an HTML table to a PDF using fpdf. Is there a way to transform an HTML table into an image (via URL link)? ...

Having issues with Ajax, looking for a solution

I've been working on implementing some AJAX functionality into my website. When users click on the navigation, the page transitions to another one. I found a tutorial on this link, and it's working well for the most part. However, there are a few ...

variable containing a combination of left-to-right and right-to-left characters

I am working on a piece of text which contains Hebrew (rtl) and English (ltr) letters. It is a song with chords placed above the words. The issue I am facing has to do with the chords - because the site is rtl, the chords appear messy. Is there a way to h ...