Fixed to the center right of the browser are social icons

My goal is to always have my social icons positioned on the right side of the browser, even when it's resized. Check out this JSFiddle for the current behavior: http://jsfiddle.net/SHHM8/.

HTML

<div id="fixedsocial">
    <div class="facebookflat"></div>
    <div class="twitterflat"></div> 
</div>

CSS

#fixedsocial {
    top:30%;
    height:200px;
    width:60px;
    position:fixed;
}

.facebookflat {
    background:url("http://placehold.it/50x50");
    height:50px;
    width:50px;
   transition:ease 500ms;
    background-size:50px;
    opacity:1;
}

.facebookflat:hover {
    background:url("http://placehold.it/50x50");
    height:50px;
    width:50px;
    background-size:60px;
    opacity:0.5;
    transition:ease 500ms;
    margin-left:-20px;
    width:70px;

}

.twitterflat {
    background:url("http://placehold.it/50x50");
    height:50px;
    width:50px;
    transition:ease 500ms;
    background-size:50px;
    opacity:1;
}

.twitterflat:hover {
    background:url("http://placehold.it/50x50");
    height:50px;
    width:50px;
    background-size:60px;
    opacity:0.5;
    transition:ease 500ms;
    margin-left:-20px;
    width:70px;
}

I've attempted to float the 'fixedsocial' container to the right using

float:right;

But unfortunately, that didn't work as expected.

Could someone assist me with making the icons fixed to the center right side of the browser? Any help would be greatly appreciated. Thank you!

Answer №1

To complete the design, simply include right: 0 in your style for the #fixedsocial element.

#fixedsocial {
    top:30%;
    height:200px;
    width:60px;
    position:fixed;
    right: 0;
}

View updated Fiddle here

Answer №2

If you're looking for a solution, consider implementing this code snippet:

#fixedsocial {
  position: fixed;
  right: 0;
  top: 50%;
}

Answer №3

It is a common occurrence,

padding:20%;
height:150px;
width:80px;

Your #socialmedia sidebar will remain fixed at the top of your browser window, occupying 20% of the total height. By adjusting the padding to a fixed value, you can easily resolve this issue

experiment with

padding-top:100px;
height:150px;
width:80px;

Answer №4

Here is an example of what you might need:

.navigation-wrap{
    position: fixed;    
    width: 60px;
    height:200px;
    top: 40%;
    margin-top:-100px; /* Should be half of the height */
}

For further details, check out this article: Responsive Sticky Social Sidebar Tutorial

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

The challenge of handling overflow in IE9

I'm encountering an issue specifically in IE9 where a child div is not respecting the overflow:hidden property of its container div. The outlined blue div in the image represents the container with overflow:hidden. The goal is for the images to stay w ...

Converting my HTML navigation menu to PHP

In the past, this is what I had: <li><a class="selected0" href="/dbp/dbma.html">Dashboard 0</a></li> <!-- First dashboard selection --> <li><a class="select1" href="#" onclick="r ...

Challenges Encountered with Random Image Generator in JavaScript

I am encountering an issue with a script that is supposed to change the default images to a random image each time the page is refreshed. However, I keep receiving an error stating that boxID is null. Why is boxID null? <script type="text/javascript" ...

The element will only show up upon resizing (in Safari web browser)

I am facing a problem with a button styled using the class btn-getInfo-Ok <button class="btn-getInfo-Ok">Hello</button> in my style.css file .btn-getInfo-Ok { color:white !important; margin: 0 auto !important; height:50px; bottom:0; ...

Auto-fit HTML Webpage Resizer Simplified

Just finished my very first jQuery project, a simple full-width slider. I've been focusing on HTML & CSS and currently working with C#. The problem is that I don't want the page to be scrollable; I want it to autofit to the webpage. Imagine ope ...

Why is tr.myClass not functioning properly without the presence of >td? How can I determine the

In my HTML, I have a table as shown below: var selector = $("#searchResultsArea"); $.getJSON(url, null, function (data) { selector.empty(); var html = "<table id=\"tabRoom\" style=\"width: 950px; border:none\" class=&b ...

Transforming a CSS Clip Path into an SVG Clip Path without the need for an image

I have a basic HTML structure: .btn_clip { display: block; width: 524px; height: 170px; background: #ed1c23; font-size: 25px; color: #fff; text-align: center; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); line-heig ...

I am puzzled as to why the frames in my code are failing to display

I'm attempting to create a simple two-frame menu and content system, but I've been struggling to display the frames properly. Here's the snippet of code that I'm working with. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http: ...

stopping the current menu selection from altering its color

How can I stop the color change when hovering over the selected menu item? Here's my code: <html> <head> <title> Another Page </title> <link rel="stylesheet" href="style4.css" type="text/css" /> & ...

Two distinct sets of radio buttons with separate functionalities

I have a unique situation where I have two distinct sections that contain sets of radio buttons with different values and IDs. However, I am facing an issue as I can only select one button at a time for both sets. My requirement is to have these two sets ...

The website is not optimized for mobile viewing

I have recently made an existing website responsive using Twitter Bootstrap. Everything seemed to work fine when I tested it by resizing the browser window, as it perfectly fit in the viewport. However, upon checking the site on mobile and tablet devices, ...

Utilize Bootstrap v4 in styling and aligning buttons for a polished

With Bootstrap v4 dropping the .btn-group-justified class, a solution can be found at https://github.com/twbs/bootstrap/issues/17631 Here's how to justify the buttons: <div class="btn-group btn-group-justified" role="group" aria-label="Justified ...

Python Regex Webpage

Looking for assistance in creating a regular expression to extract data from a webpage. The specific webpage of interest is: The goal here is to capture the text "Dallas" from the following snippet of HTML code: <a href="/county/Dallas_County-TX.html" ...

Library of User Interface components for React Native applications

As I embark on my journey of building my first major app using React Native, a question comes to mind. Is there a UI framework available for React Native that offers pre-styled components right out of the box? Similar to how Ionic provides a base theme a ...

Open the HTML file for this multi-tabbed AngularJS webpage

I stumbled upon this jsfiddle demo code that offers multiple tabs for a single AngularJS webpage. http://jsfiddle.net/helpme128/99z393hn/ I decided to integrate it into my own project. I specifically wanted one tab to load a particular webpage called my- ...

Webpack is failing to load the logo PNG image file

Is there a way to make the logo png file visible on the webpage? I have been encountering issues with loading the image while other elements like HTML, css, and fonts are loading properly when the web pack is started. List of Error Messages: Refused to a ...

Align one element vertically at the bottom

I am facing an issue with aligning a single child element to the bottom of a holder div that has fixed dimensions. Currently, I have another element with the same height as the container, which helps in alignment at the bottom. However, when this second el ...

What could be causing jQuery to fail to detect changes in the HTML code?

Whenever I trigger an Ajax request and update an attribute value, the DOM reflects the changes as expected. However, upon clicking the button again, the console displays the old attribute value. It seems like the markup isn't recognizing the change an ...

PHP time counting script

Can a countdown script be created using PHP? Websites like 4shared.com or megaupload.com utilize a similar script that starts counting from 20 seconds to 0. I am able to see how many seconds are left on the web page before I can click on the download but ...

Having trouble with media queries on my iPad

I currently have a media query set up as follows: @media only screen and (max-width: 959px) It works when I resize my browser, however, it does not seem to be functioning correctly when my iPad is in portrait mode. When I include and (max-device-width: 9 ...