When the page is resized, the Font-Awesome icons shift position

/* icon sect*/

.social {
  margin-top: px;
  padding: 0;
  position: absolute;
  top: 60%;
  left: 50%;
transform: translate(-50%,-50%);
}

.social li {
  list-style: none;
  float: left;
  margin: 0px;
  width: 60px;
  height: 10px;
  line-height: 60px;
  text-align: center;
  background: #;
  border-radius: 50%;
  font-size: 50px;
  position: ;
  transition: .5s ease-in-out;
  color: #004d26;
  z-index: 1;
}

.social li:before {
  content: '';
  width: 100%;
  height: 100%;
  position: ;
  top: 0;
  left: 0;
  background: #ff003b;
  border-radius: 50%;
  transform: scale(0);
  transition: .5s ease-in-out;
  z-index: -1;
}

.social li:hover:before {
  transform: scale(.9);
}

.social li:hover {
 color: #979FA8;
}

Hello there! I'm facing a little challenge where my font awesome icons seem to move when I click and hold at the bottom of my web page and pull up to minimize the screen. I am looking for a solution to keep my icons in their place without any movement. Your assistance is greatly appreciated! If this query has been addressed before, I apologize for the repetition as I have not been able to find a fix.

Answer №1

Welcome to the world of HTML and CSS! If you're looking to expand your knowledge, check out the site MDN.

Here's a link to the modified code that I believe accomplishes what you're looking for (although not necessarily the most efficient method).

I decided to remove the absolute positioning of the element and instead used text-align: center to achieve the central alignment you were aiming for.

If you want the element to be fixed relative to the parent, consider using absolute positioning with a relative positioned parent element.

I also made some adjustments to the styles of the .social class.

.social {
  text-align: center;
}

Additionally, I replaced the float: left; property with display: inline-block; within the selector .social li.

.social li {
  display: inline-block; 
}

Happy coding! And remember, you can always utilize pre-made templates like Bootstrap to create personalized "about me" pages.

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

Steps for incorporating monaco-editor into a website without utilizing nodejs and electron

Currently, I am working on building a basic web editor and came across Monaco-editor. I noticed someone using it with Electron, but I am interested in integrating it into plain JavaScript just like on their webpage (link). However, I am struggling to fin ...

Switching background images with Javascript through hovering

I am currently working on implementing a background changer feature from removed after edits into my personal blog, which is only stored on my local computer and not uploaded to the internet. However, I am unsure of what JavaScript code I need to achieve t ...

Difficulty aligning headings in HTML

I'm puzzled by a strange 1px gap on the left of my h2 heading, which sits atop an h3. The font sizes are set to 40px for h2 and 12px for h3. Can anyone help me solve this mystery? Any assistance would be greatly appreciated! Thank you body { pa ...

The collapsible HTML menu is malfunctioning

Can anyone assist me? I'm having trouble with the collapsible menu on my website not showing all three lists when clicked. I am using the following script link: src="http://code.jquey.com/jquery-1.11.2.min.js", or perhaps I have linked it incorrectly ...

relocating the input field underneath the button

I need help figuring out how to arrange this. Here's an example link: http://jsfiddle.net/VBS4E/25/ Is there a way to position the input field directly below the button? Like this: ________ __________ __________ | Btn#1 | | Btn#2 | | Btn# ...

The Yeoman/Grunt-usemin is failing to update the index.html file even after adding new JavaScript code

As I work on developing a web app using Yeoman and the Angular generator on Windows 7, I go through the process of running 'yo angular' followed by 'grunt' to build the app for deployment. The index.html file in the dist folder gets upd ...

What is the best way to create vertical separators between CSS grid elements?

I currently have a grid with 3 columns and would like to add two vertical lines to separate the elements. To achieve this, I have placed two span elements between the grid elements using css styling. .vertical_line { position: absolute; height: 100%; ...

Sorting feature fails to function properly when used in combination with pagination and

<table> <thead> <tr> <th class="col-md-3" ng-click="sortDirection = !sortDirection">Creation Date</th> </tr> </thead> <tbody> <tr dir-paginate="item in items | filter:itemFilter | items ...

PHP - What is the reason for the output being a multi-dimensional array?

Hey there, I'm currently working with this code and for some reason, the variable records2 is returning a multi-dimensional array. Can anyone help me figure out why this is happening? I actually need it to be a simple, single dimension array. functi ...

Flashing on objects, Chrome-exclusive, utilizing background-blend-mode exclusively

Our website, www.desirio.com, utilizes a background-image on the body with the following CSS property: background-blend-mode: luminosity An issue we have noticed in Chrome is that when hovering over elements, strange white lines randomly flash on the scr ...

PDFMAKE: A Guide to Duplicating Elements in the 'Content' Array

I have an Array within Items. My goal is to display them in a Table format using PDFMake. table: { multiple pages headerRows: 2, widths: ['auto', 100, 200, 'auto', 'auto', 'auto'], body: [ ...

Merging Angular with jQuery: Organizing jQuery into a distinct file leads to the error message 'Property 'top' cannot be read because it is undefined.'

My project is based on AngularJS, and I've been trying to incorporate a jQuery code for a sticky sidebar feature. Strangely enough, when I tested my code on Plunkr, it works perfectly fine. However, when I try to implement it in my actual project, it ...

The boundary extends fully to the right

Recently, I created a calculator to convert kilograms to pounds and encountered an issue when trying to add a border to a p element. The problem was that the border extended all the way to the right side of the page. Here is the corresponding HTML code: &l ...

Accelerate loading times of HTML files on Android apps

After clicking on an image, I want the corresponding HTML page to load instantly. However, there is a delay of a few seconds before the page actually appears. How can I reduce or eliminate this waiting time and ensure that the page loads as quickly as po ...

Attempting to extract data from a text input field using AJAX and then transferring it to a different webpage

Having trouble getting the values entered in a textbox using ajax and sending them to another .php file. I was successful with a checkbox before, but unable to replicate it this time. Below is the code for the text boxes: <div align = "right"> & ...

Enabling a read-only textbox based on dropdown list selection without requiring a postback

How can I dynamically make a textbox read-only when a specific option is selected in a combo box, without causing the web page to reload? I'm designing a sickness form where I want certain text boxes to become read-only if the user selects that they h ...

Tips for placing input fields beside one another in Bootstrap 3

How do I resize and align these 3 input fields in a small size within the modal window: <div class="form-group"> <label for="name" class="col-sm-2 control-label">Name</label> <div class="col-sm-10 inline-fields"> < ...

The font size calculation is larger than the CSS definition on the Asus Nexus 7 device

Running the website on an Asus Nexus 7 (developed in jQueryMobile), I set the font size in CSS to be 14px. However, while debugging using Chrome on my PC, I noticed that the computed size is actually 22px. Here's a snippet of the HTML code: <div ...

Utilizing ellipses within a list item to create a visually appealing design

I've been struggling with this problem for hours, but I can't seem to find a solution. How can I ensure that the text in a list item respects the size of its parent container and uses an ellipsis when necessary? Here's the scenario: <?P ...

Footer Section (navigation) bounces up when scrolling to the beginning of the page

I am currently developing a fully web-based app-style layout. One issue I'm facing is that the navigation menu jumps slightly when I use my S3 to auto-scroll to the top by dragging. However, if I scroll up manually without lifting my finger, this pro ...