Ensuring the bottom border of an element extends to the edge of the screen when utilizing a 960 grid in HTML/CSS

I am currently working on creating a website layout using the 960 grid system developed by Nathansmith. I am facing an issue in extending the bottom border of an element to reach till the end of the screen while keeping the element inside a container div.

To better understand my problem, please refer to the image provided for a visual explanation. You can view a larger version of the image here.

In the first image, you can see that the element has a fixed width, while in the second image, the border extends to the edge of the screen. How can I achieve the result shown in the second image?

Just a note, there is usually a logo image floated to the right before the menu section.

Any help or suggestions would be greatly appreciated. Thank you in advance!

Answer №1

If you're looking for a straightforward solution, check out this link: http://example.com/simplehtmlcode

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8>

<style media="all">
body, ul, li {margin: 0; padding: 0;}
.container {width: 800px; margin: 0 auto; background: #f0f0f0; min-height: 500px;}
.navlist {list-style: none; float: right; position: relative;}
.navlist li {float: left; margin-left: 15px;}
.navlist li:first-child {margin-left: 0;}
.navlist li a {text-decoration: none; display: block; line-height: 2em; text-transform: uppercase;}
.navlist li a:hover {text-decoration: underline;}

.navlist:after {
    content: "";
    height:0;
    width: 9999px;
    border-bottom: 1px solid #ddd;
    position: absolute;
    left: 0;
    bottom: 0;
}
</style>

</head>
<body>
<div class="container">
    <ul class="navlist">
        <li><a href="">Item 1</a></li>
        <li><a href="">Item 2</a></li>
        <li><a href="">Item 3</a></li>
        <li><a href="">Item 4</a></li>
        <li><a href="">Item 5</a></li>
        <li><a href="">Item 6</a></li>
    </ul>
</div>
</body>
</html>

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

Injecting background images with CSS in Vue3

After exploring answers to my previous inquiry, I am now seeking guidance on how to inject both a variable and a URL image into my scoped CSS. Despite trying various combinations, none seem to be effective: <template> <header class=< ...

Embedded Twitter posts are not showing up correctly when using vue

My backend is Django and frontend is Vue. In one of my models, I have a rich text editor. When saving the content, it converts tweet links to embedded HTML tweets. While displaying this content in a div with v-html binding in Vue, everything appears as exp ...

assigning attributes to web addresses

Is there a way to set a style property for webpages by targeting addresses that contain /index.php/projecten/ instead of specifying each complete address in the code? Currently, I am using the following code: <ul class="subnavlist" style="display: &l ...

Disable the meta tags in Zurb Foundation 5

I have searched extensively online but haven't been able to find a solution for this issue. How can I disable these zurb foundation 5 meta tags in the <head>: <meta class="foundation-mq-small"> <meta class="foundation-mq-small-only"> ...

Ensuring Proper Highlighting for HTML Select Options

I am working on a project involving an HTML Drop-down menu. Check out the code I have so far: http://jsfiddle.net/dineshk/u47xjqLv/ HTML Code <select> <option class="first" style="display:none;">HH</option> <option class= ...

Tips for deactivating all JavaScript events on a webpage that has been loaded within an iframe

My website is equipped with various JS click/mouseover/mouseout/scroll events and incorporates several JS libraries to operate features such as carousels, bootstrap modal pop-ups, and more. I am looking to halt all events on a specific element. Although I ...

Start and Pause PHP Execution on Demand

In order to pause the execution of PHP/HTML code and resume it by clicking on a "continue" button, here is an example: <?php echo "Hello"; // I would like the PHP code to halt after printing "Hello" here. // Additionally, I would like to include a "C ...

Master the Art of Image Loading in Codeigniter

Hey there, I'm completely new to Codeigniter. In the Controllers folder, I've created a file called caller.php and in the \Views directory, I've created a file named home1.php. Additionally, within the root directory, I've made an ...

An error occurred: [object Object] does not support the 'popup' method

I've been attempting to close the jQuery popup by using $('#partsPopup').popup("close"); However, I encountered an error stating that there is no method called "popup". Below is the sequence of scripts that I have followed. Any assistance wo ...

Ways to ensure a ul li element perfectly fits inside a div element without any spaces

As a newcomer to CSS and HTML, I'm facing an issue with my ul li dropdown menu and login boxes. The background colors are red and blue, but there are gaps within the div that I want to fill with the height of the div. Below is the code snippet: @key ...

Displaying JSON data in an HTML table cell format

Hey everyone, I need some help with the following task: I am working on displaying a list of log lines in an HTML table. Some of these lines will contain JSON strings, and I want to format the JSON data within the table when the HTML file is loaded from ...

My React component seems to be unable to locate and process my CSS file

I am encountering an issue where my React Component is not recognizing my CSS file. Here is the code snippet from my React component: import React, { Component } from 'react'; import './Jumbotron.css'; class Jumbotron extends Compone ...

Initiate Bootstrap 4 dropdown menus from the initial menu point

I need the dropdown menus to align with the position of the first dropdown. There are multiple dropdowns on the page. Check out the screenshot for reference. JSFiddel: https://jsfiddle.net/kfh9Lbep/ Any ideas on how to achieve this alignment? <div cl ...

Is it possible to customize the arrow on a drop-down menu?

Here is an example of the page I am facing issues with: If you look at the right side of the bottom bar, you will notice a selection option for different themes. I have been attempting to replace the down arrow with an image. Below is the code I have used ...

How can I position a vertically centered image to the left of a block paragraph using inline styles?

I am faced with the challenge of aligning a 100x100 vertically-centered image to the left of a text block that extends beyond its height. It is important that the text does not wrap underneath the image but stays in a single block on the right side. I must ...

The issue of JQuery UI Dialog remaining open even after triggering it through an Input focus event

I am facing an issue with JQuery and JQuery UI. I thought upgrading to the latest stable version would solve it, but unfortunately, that was not the case. I am currently using Chrome. When I initiate the dialog by clicking on a specific element, everythin ...

Can pagination numbers in Jquery DataTable be configured based on the total records returned by the server and the number of records chosen by the user?

I am currently diving into the world of DataTable.js, a jQuery plugin, and working hard to articulate my questions effectively. For my specific needs, I need to retrieve only 10 records initially whenever an AJAX request is made, even if there are 100 rec ...

A confined space that is scrollable, yet keeps any overflow hidden without displaying a scroll bar

Is there a method for creating a overflowing div that conceals the overflow, does not display a scroll bar, but remains scrollable (via mouse wheel or touch input)? For example: <!DOCTYPE html> <div id="longtext" style="width:100px; height ...

the battle between width and max-width for creating responsive web layouts

Many tutorials suggest using max-width:100% for images in responsive web design to ensure flexibility. However, why is it also possible to achieve the same result by using width:100%? ...

Preventing the display of AngularJS HTML tags while the app is being loaded

I am new to AngularJS (using version 1.5.8) and I am currently following the tutorials provided on docs.angularjs.org/tutorial. Below is the HTML code snippet: <div class="jumbotron"> <h1>{{application_name | uppercase }}</h1> ...