Background extending to full width for the main content area

There seems to be an issue with the background of .main. I am unable to achieve full width for the background. I have reviewed similar questions but couldn't resolve it. Below is my code snippet and fonts for better understanding: Fonts

<!DOCYPE html>
<html>
<head>
<title>MaxSkins-Home</title>

<style type="text/css">

body {
background-color: white;    
background-attachment: fixed;              
margin: 0;
padding: 0;
width: 100%;
height: auto;
min-width: 1000px;
}

@font-face {
font-family: "Jocker";
src: url("JockeyOne-Regular.ttf") format("truetype");
}

@font-face {
font-family: "Pacifica";
src: url("PacificaCondensed-Regular.ttf") format("truetype"); 
}

@font-face {
font-family: "ReklameScript";
src:url("ReklameScript.ttf") format("truetype");
}

h1 {
font-size: 120px;
text-align: left;
font-family: "Jocker";
margin-left: 45;
color: rgb(200,101, 103);
}

h2 {
font-size: 70;
margin-left: 224;
font-family: "Jocker";
color: rgb(200,101, 103);
}

#header {
width: 100%;
height: 50px;
margin: auto;

}

#navigacija {
width: 100%;
margin-left: 0px;
padding: 0px;
height: 50px;  
overflow: hidden;
text-align: right;
position: fixed;
background-color: #089DE3;
z-index: 9999;
}

#navigacija a {
color: white;
text-decoration: none;
line-height: 50px; 
font-size: 30px; 
font-family: "Pacifica";
display: inline-block;
padding-left: 50px;
padding-right: 50px;
padding-top: 0px;
padding-bottom: 0px;
}

#navigacija a:hover {
background: #00C5CD;
}

.main1 {
margin-top: 50px;
font-family: "ReklameScript";
font-size: 50;
background: #089DE3;
text-align: left;
margin-left: 194;
}

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 0px;
height: 0;
overflow: hidden;
bottom: 930;
right: 0px;
}
.video-container iframe,  
.video-container object,  
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.video-wrapper {
width: 640px;
float: right;
margin-left:auto;
margin-right:auto;
max-width: 100%;
}
</style>


</head>

<body>
<div id="header">
<div id="navigacija">
     <a href="Home.html"><b>HOME</b></a> 
     <a href="Shop.html"><b>SHOP</b></a> 
     <a href="#"><b>GET POINTS</b></a> 
     <a href="#"><b>INFO</b></a> 
     
  </div>
</div>


<h1><b>EARN POINTS,<br> GET SKINS!</b></h1>
<h2><b>How does it work?</b></h2>
<div class="main1">
<p><b>It's simple!<br> Watch videos, do tasks and have fun!<br>After earning large amount of coins,<br> contact us to get your skins!<b></p>

</div> 

<div class="video-wrapper">
<div class="video-container">
<iframe width="640" height="360" src="https://www.youtube.com/embed/lwItL2NXwDw" frameborder="5" allowfullscreen></iframe>
</div>
<!-- /video -->
</div>
<!-- /video-wrapper -->
</body>
</html>

Answer №1

Your issue appeared to be related to some invalid CSS syntax. The presence of a <style></style> tag in your CSS was unnecessary, as it is only required when the CSS is embedded within HTML markup.

After removing the extraneous HTML tags from your CSS, I noticed that the background for .main1 now spans the full width. Was this the resolution you were seeking?

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

What is the best way to determine if an HTML element reaches the bottom of the browser window?

In this scenario, my div is intersecting the bottom of the page. How can I use JavaScript to determine if this element is intersecting with it or not? For example, if bottom:0px; should not be intersected. .fixed{ position:fixed; bottom:-10px; le ...

Tips for adjusting the slider label to move horizontally to match the width of the slider using CSS

Is it possible for the label of the slider to smoothly slide along the X axis to adjust to the current width of the slider? I have demonstrated this effect in a gif. It's a bit challenging to describe in words, so please watch the gif to grasp what I ...

Retrieving all options from a dropdown list in HTML using ASP.net C#

I am currently working with a select list that looks like this: <select name="Section" id="Section" size="5"> <option>Section1</option> <option>Section2</option> <option>Section3</option> <option>Section4< ...

Freemarker substitute & and &ampersand;

I am facing an issue with Freemarker. I need to eliminate all the special characters from this sentence as well as from similar sentences in the future: BLA BLA RANDOM &, RANDOM BLA In particular, I want to remove the & character. The platform ...

What causes the circular progress bar to disappear when hovering over the MUI React table?

My goal was to create a table with a CircularProgressBar that changes its background color from orange to dark blue when hovering over the row. However, despite my efforts, I couldn't get it to work as intended. Additionally, I wanted the progressBar ...

What is the best way to conceal an element and its descendants from being read by screen readers?

What is the best method to conceal an element and its children from both screen readers and keyboard access? Currently, I am focused on improving accessibility for the pages under my maintenance. However, there are certain advertising banners that cannot ...

Embed PHP file

This is my first venture into website development using php. I thought I had come up with a clever way to include the css sheet based on the file location. One example is when I submit a form with this code: $root = '../'; function died($err ...

Remove any div elements that do not contain any content

I have a method on my front end that receives HTML as a string from the backend Here is the code snippet: private async tryGetOooMessage(employeeId: string): Promise<string> { try { return await firstValueFrom(this.messages.getOutOfOfficeI ...

Identify changes in attributes on elements that are updated automatically

On my webpage, I want to have two select boxes that are connected so their values always match. Here's an example: Imagine a page with two selects: <select class="myselector"> <option value='1'>1 <br> < ...

Utilizing AJAX to dynamically update a div's content by extracting a specific div from the retrieved data

Although I believe my code is correct, I am not very familiar with AJAX and have been struggling for hours to get it right. I've tried various approaches, including using filters, but nothing seems to work. The issue I'm facing is that the chat m ...

Tips for implementing a transparent background color using CSS in LayerSlider for WordPress

From the screenshots provided at https://i.sstatic.net/7xUaY.jpg and https://i.sstatic.net/jMENP.jpg, it is evident that I am using layerslider wp. I am seeking assistance to make the background surrounding the text transparent. The second screenshot displ ...

In the Twitter Bootstrap documentation, which element is utilized for the sidebar?

I'm curious about the most efficient method for creating a sidebar like this using Bootstrap 4. https://i.sstatic.net/3eKwN.png From what I can see, it appears to be a custom component designed specifically for the documentation page, rather than ...

What could be causing the inability to retrieve the HTML content of $(window['iframeName'].document.body) when I modify the .attr('src') method?

Why isn't it functioning $(window['iframeName'].document.body).html() ...properly when I update the .attr('src')? When I initially set the src attribute of the iframe to a URL upon creating the page, this code $(window['i ...

Removing an element with a specific class that was created with Javascript can be done by clicking outside the box

I needed to eliminate an element that was created using JavaScript of a specific class when clicked outside the box. I have created a color-picker using .createElement and added a class to it. Now, my goal is to remove that picker whenever a click occu ...

Eliminate the ending question mark when using the form method=get

Whenever I click a form button that redirects me to a page, it keeps adding a trailing question mark at the end of the URL. Here's an example: http://example.com/folder/upload/? This is how my code currently looks: <form method="get" act ...

Unable to modify the .Css file for the VueJs plugin

I've been utilizing the vue-js-modal plugin and inside, there is a style.css file. I attempted to customize the modal style by making changes to this file, but even after saving my modifications and running the application, the modal page still reflec ...

Styles are not being applied to the <label> element in CSS

While designing a form, I encountered an issue with applying CSS to set the size of the label and aligning it to the right for a more polished appearance. Here is the snippet of code I used: label{ width: 50%; text-align: right; } Link to Fiddle ...

What causes the difference in length between a CSS selector and a jQuery selector return value?

After some investigation, I have observed a discrepancy between two expressions that I thought should return the same length (refer to the console output): var cssSelector = $('#target').siblings('table > tbody > tr > td') ...

The Sublime/TAG feature "Eliminate Selected Attributes from Tags" does not support the removal of "data-reactid" attributes

I am attempting to utilize TAG in Sublime Text 3 -- https://github.com/titoBouzout/Tag When I apply the "Remove Picked Attributes From Tags (in Document)" feature with class it successfully eliminates all class attributes. However, when I use it with ...

Incorporating PHP Code within HTML

Could you please advise me on how to use a variable instead of a constant in this scenario? For example, I currently have this statement: <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/abc.css')?>"/> ...