Expanded Image with Text/Button (Adaptable)

Currently, I am in the process of working on a complex project for a client. The task at hand involves designing a full screen landing page that must be compatible with various window sizes as well as mobile devices (responsive design). However, I am facing an issue where I cannot get the image to cover the entire page within the designated div (slider-full-width). It is imperative that this div spans the entire window width. To better illustrate my goal, I have provided an image for reference. It is worth noting that I am utilizing the Skeleton Framework for this project (). Moreover, it is essential that users can continue scrolling down to access the remaining content on the page following the full screen landing section.

Here is a snippet of my HTML:

<div id="slider-full-width">
<div class="container">
  <h2>Seeking a refreshening management service?</h2>
  <h2>You've come to the right place</h2>
  <div id="button-bg">
  <a href="properties.html" class="presentation-button">Properties</a>
  <a href="#body-span-class" class="presentation-button">See why</a>
</div>


Below is an excerpt from my CSS stylesheet:

#slider-full-width{
width: 100%;
background-image: url('../img/slide-01.jpg');
position:relative;
text-align: center;}
#slider-full-width h2 {
color: #efefef;

}

Your assistance is greatly appreciated in advance!

Answer №1

I'm not sure why there is a blank space at the top, but I have prepared a jsfiddle demonstration to show you how I removed it: http://jsfiddle.net/qRpGh/

HTML:

<div id="full-width-slider"> <div class="container">   <h2>Looking for a
rejuvenating property management service?</h2>   <h2>You're in the right
place</h2>   <div id="button-bg">   <a href="properties.html"
class="presentation-button">Properties</a>
  <a href="#body-span-class" class="presentation-button">Explore more</a>   </div>

CSS:

#full-width-slider{ max-width: 100%; min-height:800px; background: url('http://www.wherelionsroam.co.uk/image/two.jpg') no-repeat center
center fixed; -webkit-background-size: cover; -moz-background-size:
cover; -o-background-size: cover; background-size: cover;
position:relative; text-align: center; } #full-width-slider h2 {
color: #efefef; margin-top:-20px; font-size: 25.29pt; padding-top:
285px; text-shadow: 1px 1px 1px #000; }

I included the background-size:cover properties for all major browsers to ensure the best cross-browser compatibility. I hope this solution resolves your issue!

Answer №2

For those seeking to make the background image completely cover the div, consider implementing this within your selector:

#full-width-slider {
    /* Insert your code here */
    background-size: cover;
}

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

I would like to apply my CSS styles to all the hyperlinks on my website

This is the CSS code I created: img{width:85%; height:auto;} #thumbwrap { position:relative; } .thumb img { border:1px solid #000; margin:3px; float:left; } .thumb span { position:absolute; visibility:hidden; } .thumb:hover, .thu ...

The Street View feature on Google Maps API is now showcasing a cool,

I have been attempting to showcase the interior of various businesses using the Google Maps API street view feature. Initially, I was able to retrieve the place_id and then use it to access any available street view panoramas. However, this functionality s ...

Attribution of image in footer

The image above the footer is not displaying properly. Screenshot: Image appears below the footer https://i.stack.imgur.com/RvSqI.png Source Code .footer-area { background-position: center; position: relative; z-index: 5; } .footer-area::before { ...

What is the best way to show a label and select box side by side using Angular Material?

I have been trying to keep input and label in the same line using Angular Material, but I haven't found a solution yet. Most of the available solutions are in HTML and CSS, but I specifically need a way using Angular Material. The method I tried invo ...

The issue of CSS not functioning properly in a template that includes JavaScript, despite the HTML file being located within a

I'm a complete beginner when it comes to working with templates. I've run into an issue where my CSS doesn't seem to work when I place my HTML in a different folder. After some investigation, I've discovered that the CSS is being appli ...

A comprehensive guide to utilizing VueJS for creating dynamic lists

I am trying to associate my timer with a list in my project <div class="row row-cols-2 justify-content-md-center" v-else-if="timerData.length <= 4" style="height: 100vh; background: none"> <div v-for="(t, in ...

Change the value of a cell in a table dynamically with the use of Angular

I am currently developing a web application using Angular 6. Within the HTML template, I have included some code that showcases a specific part of an array within a table cell. It's worth noting that the table is constructed using div elements. <d ...

aligning radio buttons and labels on the same horizontal axis

Is there a way to ensure that radio buttons and their labels appear in the same line? I've tried adding margin and padding properties to the span tag, but it doesn't seem to work. Any suggestions on how to solve this issue? <form class="navba ...

What is the best way to pinpoint a specific Highcharts path element?

I am currently working on drawing paths over a graph, and I am looking to dynamically change their color upon hovering over another element on the page - specifically, a list of data points displayed in a div located on the right side of my webpage. Below ...

I am curious about this "normalize.less" that appears in the F12 Developer Console

Trying to track down information on this mysterious "normalize.less" that is appearing in the Chrome 76 developer console has proven to be a challenge for me. In Firefox 69's console, it displays bootstrap.min.css instead, leading me to believe that i ...

Steps to make a link that can call a phone number directly from a mobile device

Can an image be designed to initiate a call when tapped on a mobile device? Or perhaps pre-populate the number in the phone dialer? I believe I've come across similar functionality on mobile sites in the past. ...

How to Generate Slanted Header Text Using Only CSS

What is the method for creating a diagonal heading line using only CSS, as shown in the image below: ...

Ensuring the width of a div matches the adjacent containers

I need assistance in creating a form that adjusts its width based on the form fields. The form contains both explanatory text and input fields, each enclosed in a div with inline-block set. The outer div (also using inline-block) should not expand beyond ...

Is it possible to size a child div to be larger than its parent without using absolute positioning?

I'm trying to figure out a way to have one or two divs on a page that are larger than their parent div without having to overhaul the entire website structure. I originally considered using position absolute, but that would mess up the container heigh ...

Customizing Material UI Popover CSS classes within a Select component in a React application

I have integrated the Material UI Select component into my React project. I am attempting to customize the CSS classes .MuiPaper-root and/or .MuiMenu-list. This is how my Select component looks: <Select value={selectValue} disableUnderline onCha ...

Maintain the expanded sub-menu when the mouse leaves the area, but a sub-option has been

Implementing a side menu with parent and child options that dynamically display content in the main div on the right when a child option is selected. The parent options are initially shown upon page load, and the child options appear when the mouse hovers ...

What is the best way to align navigation arrows vertically?

I am working on a modal album that displays images of various sizes. My issue is with styling the navigation arrows to appear in the center of the page, regardless of the image size. I have included my code below: <div class="row img-box"> <d ...

Tips for adjusting image size within a Bootstrap card

I am having trouble getting the images to properly fit inside the card. Even when I set the width to 100%, they are not adjusting correctly. Can anyone provide guidance on how to fix this issue? Thank you Below is the HTML code for the card: .card { ...

Loading a webpage once the loading bar has completed

Is there a way to modify the JavaScript code for my progress bar that loads from 1 to 100 percent so that it automatically redirects to another page when reaching 100%? Here is the current JavaScript code: var i = 0; function move() { if (i == 0) { ...

Problem with <meta> tag occurring when initial-scale is adjusted

Initially, in the index.html file: <meta name="viewport" content="width=device-width, initial-scale=1" /> I decided to modify it to: <meta name="viewport" content="width=device-width, initial-scale=2" /> ...