What is the best way to position my image on the right side of the page?

Trying to position an image on the right side, but facing issues with overlapping social media icons when using the pull-right class in bootstrap.

Desired image layout:https://i.sstatic.net/tyfjW.png

UPDATE:

For reference, here is a link to the header in a jsfiddle:

JSFIDDLE

-

Answer №1

If you find yourself using the class pull-right and it remains stuck in place, it could be due to the parent div not extending the width of the navigation bar. I recommend placing the image in a div that spans the entire width of the nav bar before applying the pull-right class. Utilize Chrome's dev-tools to easily identify the specific div to place the image in. Hopefully, this solution works for you!

Apologies for not being able to post this as a comment, as I am still below the required 50 rep mark.

UPDATE: Check out this functional JSFiddle with the fix implemented, in case others encounter a similar issue!

Answer №2

To align the center of the middle logo, use

justify-content:center; display:flex; width:100%;
and to move the orange bar to the right, use
position:absolute; top:15px; right:0;
. I have implemented inline styling, so please review the html code

/*img{
  width:200px;
  height:200px;
}*/

.navbar-wrapper {
  z-index: 999;
  padding: 0;
  -webkit-border-radius: 3px 3px 0 0;
  -moz-border-radius: 3px 3px 0 0;
  border-radius: 3px 3px 0 0;
  background-color: #1d1d1d;
  -webkit-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
  -moz-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
  border: 1px solid #000;
  background-image: -webkit-linear-gradient(ellipse farthest-corner at center 0px, #31a2a6 -150%, #333240 45%, #333240 85%);
  background-image: -moz-linear-gradient(ellipse farthest-corner at center 0px, #31a2a6 -150%, #333240 45%, #333240 85%);
  background-image: -o-linear-gradient(ellipse farthest-corner at center 0px, #31a2a6 -150%, #333240 45%, #333240 85%);
  background-image: radial-gradient(ellipse farthest-corner at center 0px, #31a2a6 -150%, #333240 45%, #333240 85%);
  position: relative;
}

.social-top {
  float: left;
  left: 8.333%;
  padding: 0;
  border-radius: 0;
  top: 30px;
  position: absolute;
}

.social-top a:before {
  border: none;
  border-radius: 0;
  content: '';
  z-index: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  -webkit-transition: all .3s ease-in-out;
  -moz-transition: all .3s ease-in-out;
  -ms-transition: all .3s ease-in-out;
  -o-transition: all .3s ease-in-out;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.social-top a {
  padding: 8px 10px 5px;
  display: block;
  font-size: 17px;
  position: relative;
  float: left;
  margin-right: 5px;
  border: 1px solid #000;
  background-image: radial-gradient(ellipse farthest-corner at center 0px, #31a2a6 -150%, #333240 45%, #333240 85%);
  color: #ff8800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

@media (max-width: 768px) {
  .social-top {
    display: none;
  }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--HEADER-->
<header>
  <div class="navbar-wrapper">
    <div class="social-top">
      <a rel="nofollow" target="_blank" href="#">
        <i class="fa fa-facebook" style="padding-right: 5px;"></i>
      </a>
      <a rel="nofollow" target="_blank" href="#">
        <i class="fa fa-twitter"></i>
      </a>
      <a rel="nofollow" target="_blank" href="#">
        <i class="fa fa-youtube"></i>
      </a>
    </div>

    <div style="justify-content:center;display:flex;width:100%;">
      <img class="img-responsive" src="https://image.prntscr.com/image/MFOIvVb5TRO8-AgQGFTJAw.png" style="padding: 15px;" alt="Hiraeth logo">
    </div>
    
    <div style="position:absolute;top:0;right:0;">
      <img class="img-responsive" src="https://image.prntscr.com/image/3knsxcoiQ2_pFpe_PcG-sQ.png" alt="Hiraeth logo">
    </div>
  </div>

</header>
<!--END HEADER-->

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

"Defining a CSS class specifically for styling the span element nested within an

The HTML structure I am working with is as follows: <p> <a href="#"> <span class = "class-for-span"> SOME TEXT HERE </span> </a> </p> Along with the following CSS: p a{ color: grey; text-decora ...

The menu field remains open even after clicking on the menu

I have encountered an issue with my code. Here is a DEMO that I created on jsfiddle.net Currently, when you click on the red div, the menu opens. However, if you click on the menu items, the menu area does not close. What do I need to do in order to clo ...

When an image is opened in a modal, it causes the original image on

I recently created a website using HTML/CSS and JavaScript, and I incorporated a modal using Bootstrap 5. To add a unique touch, I used JavaScript to replace the standard "Save changes" button of Bootstrap with a random image inside the modal. However, I n ...

Four-pointed star design with rounded edges

https://i.sstatic.net/E3ZFb.png My goal is to create a pixel-perfect star using CSS. I have attempted to achieve this so far, but the star currently has 5 points and I would like it to only have 4 points. Additionally, I am looking for a way to make the c ...

Achieving responsive design for div tags: Automatically adjust the width of left and right div tags to fit the screen, while maintaining the static

I need help figuring out how to automatically adjust the width of div 'one' and div 'three' to the screen side while keeping the width of div 'two' static using CSS. All three divs should be in the same row. Here is my HTML c ...

Is there a way to make two parallelograms overlap seamlessly and adjust in size automatically using HTML?

Recently delving into the world of HTML and CSS, I've set my sights on designing something unique involving parallelograms that adjust dynamically. My vision includes four overlapping parallelograms starting from the top at 25%, 50%, 75%, and finally ...

Using the jQuery datetimepicker in the 12-hour format with AM and PM

Hey there! I'm looking to enhance my current code by adding a feature that displays time in a 12-hour format with AM/PM. You can check out an example of this functionality on jsfiddle by following this link: http://jsfiddle.net/8ztsjcos/3/. Thank you ...

How can AngularJS effectively parse JSON data containing HTML elements?

We are experiencing difficulties in reading a json file containing html content. Here is the code snippet with the json data we are working with: Json data: { "aboutContent": { "listItems": [{ "title": "Investors", "de ...

Guide on developing a JavaScript script for implementing across numerous Bootstrap modals within a single webpage

I have been working on setting up a page with 14 different modals. Initially, all the modals were opening normally, but I recently discovered a way to make them draggable when opened. After some trial and error, I managed to implement this feature successf ...

The Cordova minification tool fails to compress files within the browser platform

I recently installed the cordova-minify plugin to compress the javascript code in my Cordova app. When I tried running the command: cordova build browser An output message appears: cordova-minify STARTING - minifying your js, css, html, and images. ...

Responsive Div that Resizes Proportionally within Parent Container

Having a div element that adjusts its height based on width to maintain aspect ratio, I aim to place this div within another while maximizing available space vertically and horizontally without any cropping. It seems that object-fit: contain, typically use ...

The integration of jQuery in PHP is experiencing some technical challenges

There's one issue driving me crazy: I created a left-floating file tree view and included it in my website. However, when I include my website in the file treeview, it becomes unclickable in Chrome, and in IE 9, the thumbnail part for viewing PDF docu ...

Having trouble getting a background image with tint to display properly in Bootstrap

I applied a sleek black transparent gradient to my body background picture, but as soon as I integrated bootstrap into the HTML code, the effect ceased to function. body { background: linear-gradient( rgba(0, 0, 0, 0.5), rgba ...

Enhancing WordPress Accessibility with Google Tag Manager

I have been utilizing the Google Tag Manager for WordPress plugin on my WordPress website. I have come across some important issues concerning compliance with the WCAG 2.0 accessibility guidelines. It has been brought to my attention that the Google Tag ...

Adjust the margins of an image within a text box

I've come across a simple yet widely used code online. I tried placing an image inside a textbox with the type of "text", but the image is touching the border of the empty box. Is there a way I can adjust the positioning of the image to the right to p ...

Issue with setting background image height to 100% or 100vh

Seeking help to address the issue of the URL field impacting the total height. Any assistance would be greatly appreciated. body,html { height:100% } Issue arises when there is a display in the address bar. .bg { min-height:100% background-size: cover; ...

What is the best way to unselect the "all" selector if one of the inputs is no longer selected?

I am facing an issue with a search filter functionality. When all filters are selected and then deselected individually or together, the "all" button remains selected. I need help in ensuring that when any filter is deselected, the "all" button also gets d ...

Creating a unique Bootstrap background design

I have recently started using bootstrap and I am facing an issue. I want to change the background of a container when hovering over it, but I am having trouble getting it right. HTML <div class="container bg-black h-25 w-25 box"></div&g ...

Position the icon to the left side of the button using Bootstrap

Need help with centering text on a bootstrap 3 button while aligning the font awesome icon to the left side. <button type="button" class="btn btn-default btn-lg btn-block"> <i class="fa fa-home pull-left"></i> Home </button> Usi ...

Three-handled slider

Just acquired a new slider component <input id="slider_price" type="text" class="span2" value="" data-slider-min="1000" data-slider-max="80000" data-slider-step="5" data-slider-value="[60000, 80000]"/> _ $('#slider_price').slider({ t ...