Elevated Floating Button

https://i.sstatic.net/jMT5g.png

I am attempting to create a vertical floating button for my website, but the text is displaying outside of the box.

CSS

#feedback { 
  height: 104px; 
  width: 104px; 
  position: fixed; 
  top: 40%; 
  z-index: 999;
  transform: rotate(-90deg);
  -webkit-transform: rotate(-90deg); 
  -moz-transform: rotate(-90deg); 
  -o-transform: rotate(-90deg); 
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}

#feedback a { 
  display: block; 
  background: #f00; 
  height: 15px; 
  width: 70px; 
  padding: 8px 16px;
  color: #fff; 
  font-family: Arial, sans-serif; 
  font-size: 17px; 
  font-weight: bold; 
  text-decoration: none; 
  border-bottom: solid 1px #333;
  border-left: solid 1px #333;
  border-right: solid 1px #fff;
}

#feedback a:hover { 
  background: #06c; 
}

HTML

<div id="feedback">
  <a href="/feedback_url/">Test</a>
</div>

Answer №1

The issue you are facing is due to the height: 15px property. Removing this from #feedback a will resolve the problem.

#feedback a {
  display: block;
  background: #f00;
  height: 15px; /* Delete this line */

An element's height is usually determined by its content and line-height. Manually setting the height can cause problems with the content layout, which seems to be the case here.

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

switch the visibility of the p tag based on its content

It seems like solving this shouldn't be too challenging, but I'm still learning when it comes to Javascript or JQuery. HTML: <p><span id="AddLine1Summary"></span>,</p> <p><span id="AddLine2Summary"></span& ...

Modifying inner content without altering CSS styling

Inside this div, there is a paragraph: This is the HTML code: <div id="header"><p>Header</p></div> This is the CSS code: #header p { color: darkgray; font-size: 15px; Whenever a button is clicked, the innerHTML gets updated: H ...

Does activating a hyperlink on an anchor element count as a cross-origin request?

Understanding CORS: Cross-origin resource sharing (CORS) is a method that enables limited resources on a webpage to be requested from a different domain than the one where the initial resource originated. Let's say I have a simple HTML page with a li ...

Display the accurate duration based on the dates selected in an HTML form automatically

If someone has office hours on Monday, Wednesday, and Friday from 7:00 am to 7:00 pm, and on Tuesday and Thursday from 10:00 am to 9:00 pm, the dropdown menu should display only the timings of 7:00 AM to 7:00 PM if the selected date is a Monday, Wednesda ...

Converting Milliseconds to a Date using JavaScript

I have been facing a challenge with converting milliseconds data into date format. Despite trying various methods, I found that the solution provided in this link only works for a limited range of milliseconds values and fails for higher values. My goal is ...

How can jQuery be used to determine if the number of checked checkboxes is a multiple of three?

Within the ul, I have li tags with checkboxes and I want to create a function that checks, when the submit button is pressed, if the number of checked checkboxes is not a multiple of 3. If it isn't, an alert should be displayed. How can I accomplish t ...

I am encountering an issue where my codeigniter controller is unable to load my model

Below is the code for my controller: defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('User_model') ...

Why does Asp.net Webform load twice every time I click on the form link?

In my asp.net webform project, I am encountering an issue where the page is running twice when clicked. The problem arises when calling two functions (Fill DropDowns) on the Page_Load Event. During debugging, it was observed that the control enters the Pa ...

Guide to placing a heading in one corner and a button in the opposite corner

Desired Outcome: I am aiming to achieve a design similar to the one shown in the image below. Actual Result: However, what I ended up with looks more like the image below. This is my HTML: <div class="heading-container d-flex flex-row justify-con ...

Images with scratches visible in Chrome

This puzzle may seem easy to some, but it's been quite challenging for me. I've encountered a discrepancy in how Firefox and Chrome render images (specifically technical drawings). Despite my attempts to use image-rendering: -webkit-optimize-cont ...

Conceal navigation button within react-material-ui-carousel

After successfully incorporating the React Material UI carousel, I found it to be quite simple. However, one thing that eluded me was how to hide the buttons and only display them on hover. I tried setting the props navButtonsAlwaysVisible to false, but it ...

Incorporating mootools scripts into a gwt application

My issue involves creating an animation on a Composite that should start when data is loading. To test this, I created animations on regular divs using HTML: <div class="LoadDataWidget"> <div id="arrow" class="greenArrow"></div> < ...

Change the dimensions of a picture from 4:3 to 16:9 while maintaining its responsiveness using CSS

Imagine I have this image with a 4:3 aspect ratio and dimensions of 640x480: https://i.sstatic.net/p4xRM.jpg Here is the code used to display it: <img src="../static/images/image4-3.jpg" class="img-fluid" alt=""> Now ...

Single-line form with labels positioned above the input fields

For my web app project, I am using AngularJS and Bootstrap 3 for CSS (although my CSS knowledge is limited). I am trying to design an inline form with 5 input fields and labels positioned on top of them. The first field should take up more space than the o ...

Maintain the layout of HTML page while reducing the window size

My webpage is experiencing an issue. When I resize the window, the placement of all elements becomes misaligned and the layout gets distorted. ...

Activating development mode for LessCSS in Node.js

I'm encountering some major difficulties identifying LESS parse errors within a large CSS compilation. The error messages aren't providing much help (at least not for me). Here are my questions: 1. Is there a method to activate more debugging ...

Fixing the issue: "Tricky situation with JavaScript not working within Bootstrap 4's div tag while JS functions properly elsewhere"

Currently, I'm working on implementing a hide/show function for comments using JavaScript. Fortunately, I was able to find a helpful solution here (thanks to "PiggyPlex" for providing the solution on How can I hide/show a div when a button is clicked? ...

A comprehensive guide to navigating pages using AngularJS

Greetings! I've recently embarked on my Angular JS learning journey and have encountered an issue with loading content from pages. Unfortunately, I am not able to receive any content. Below are snippets of my index file and corresponding JavaScript co ...

I am puzzled as to why I keep receiving the error message "Cannot read property 'poPanel' of undefined"

CSS In my project, I am implementing a feature that displays an ordered list by looping through an array of objects and adding them on a button click. It works smoothly for adding items, but when I try to implement a remove function to delete each item, I ...

Tips on quickly validating a form using JavaScript

I've set up a form with 3 text inputs and a validation function that triggers on submit. Here's a snippet of the code: <form action="" method="post" onSubmit="return checkForm(this.form)"> and checkForm(): var pattern_name = /^([a-zA-Z ...