Can the current website navigation be integrated into the blog script?

People might see me as a spoil sport for not using Wordpress, but I prefer a flatfile blog system for my small site. Currently, I am using the ozjournals-3.2 blog system.

I need assistance in installing a header and site navigation on top of the blog page to match the existing site's layout. While I have been successful with the header, I am facing challenges with positioning the navigation bar below it as shown in the attached image. The task is posing two main difficulties:

  1. The navigation won't center on the page despite using margin: auto;.
  2. I cannot seem to place it at the bottom of the header image!

Here is the CSS code for my navigation:

.nav {
    width: 950px;
    float: left;
    margin: 0 0 1em 0;
    padding: 0;
    background-color: #3b3b44;      
    border-top: 1px solid #ccf;
    border-bottom: 1px solid #ccf;}
.nav ol {
    list-style: none;
    width: 950px;
    margin: 0 auto;
    padding: 0; }
.nav li {
    float: left; }
.nav li a {
    display: block;
    padding: 2px 20px;
    text-decoration: none;
    font-family: Helvetica, arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #fff;                  
    border-right: 1px solid #ccf; }
.nav li:first-child a {
    border-left: 0px solid #ccf; }
.nav li a:hover {
    color: #000;                  
    background-color: #8db3ff; } 

#header {
    height: 185px;
    margin-top: 15px;
    background: url(zitemplateChange.jpg); 
    border-bottom: 30px solid #cc0; 
    }

and here is the index.php file content.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" href="themes/default/zitemplateChange.css" type="text/css" media="screen" />
</head>
<body>
 <div class="nav">
            <ol>
                <li><a href="index.html">Home</a></li>
                <li><a href="about.html">About</a></li>
                <li><a href="review.html">Book Preview</a></li>
                <li><a href="http://www.tuirtre.webitry.net/guestbook/index.php">Guestbook</a></li>           
                <li><a href="javascript:popup()">Tell a Friend</a></li>
                <li><a href="contact.html">Contact</a></li>
                <li><a href="javascript:popup1()">Support</a></li>              
            </ol>        
        </div>
<!-- PHP script continues for handling sessions, post comments, user sign-in etc. -->

?>

Your support and suggestions are greatly appreciated.

Answer №1

Check out this interactive demo that showcases the solution I have implemented.

The issue stemmed from having a div with a width of 950px containing an ol also set to 950px. In situations where there is no space for margins, the browser defaults to a value of 0.

To rectify this problem, it was necessary to eliminate the float property from the outer div and configure it to width:100%;. Then, all the background styling elements needed to be enclosed within the ol. Lastly, a clearing element like <br /> had to be inserted after the ol. This ensures proper rendering of the layout.

UPDATE:

If you want to view a full-screen preview, click on this link. It may be helpful if the regular demo does not display correctly at 950px width.

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

Ensure consistency in the heights of div elements, even when the images contained within have varying heights

I created a bootstrap webpage with a row of DIVs, each containing an image. As I resize the browser window, I noticed that the height of the first two DIVs remains consistent, but the third div's height varies because the image is only 50 pixels high. ...

Utilizing jQuery and CSS to make an entire div clickable, and activate an 'a' tag hover state upon hovering

Looking to create a clickable link for the .wrapper div that directs users to the location of a.icon. Want the .wrapper div to activate the a.icon:hover state when hovered over, not just when hovering over the icon itself. Any assistance would be highly a ...

Knitting: exporting to HTML file while retaining formatting

Recently discovered the amazing knitr library in R, which looks great when viewed in the viewer. But unfortunately, the style gets lost when saved to an html file. Code library(knitr) library(kableExtra) some.table <- data.frame ( x = rep(1 ...

Best practices for organizing your Obelisk project include creating a specific folder for CSS files within

Trying to align two divs side by side using Obelisk, I referred to this post for guidance on how to do it: How to place div side by side. The solution required declaring classes in CSS. Utilizing the instructions from a tutorial (https://github.com/hansrol ...

"Usage of Wildcard in CSS Selectors for customizable path selection

When it comes to identifying elements using CSS selectors, I rely on a combination of path and attribute-based selectors for accurate results. For instance: div[attribute='test'] > div > div > div > span[attribute='test'] ...

Tips on enhancing the appearance of your numberbox with vibrant colors

Hello everyone! I am working with some devextreme code blocks and need help in changing the border color of a numberbox to red. Can anyone guide me on how to achieve this? import React, { useState } from 'react'; import { NumberBox } from 'd ...

Adjust padding of elements based on scrolling movements

Currently, I am attempting to adjust the padding of a specific element based on how far down the page the user scrolls. Ideally, as the user scrolls further down the page, the padding will increase, and as they scroll back up, the padding will decrease. H ...

Is it possible for the ".filter" function to verify if the target contains multiple attributes?

I'm currently working on a checkbox filter setup and using Jquery's .filter to sort through some divs. Below is the snippet of Jquery code that I am using: $(document).ready(function(){ var checkboxes = $('div.filter-groups').find(&ap ...

Fix the uneven shape border/outline

I made 3 circles using CSS (:after) and noticed that the border looks uneven with certain background colors. Any suggestions on how to resolve this issue? You can view the problem here: Just below the post title, you'll find the first blue circle bo ...

Overlay text on top of image with fading transparency when hovering over it

Is there a way to make the transparent layer that appears when hovering over an image on a card only cover the image itself and not extend onto the footer of the card? Currently, the image on the card covers most of it, and I want the hover overlay to beh ...

Struggle with Firefox: Table-cell with Relative Positioning Not Acting as Parent

Upon investigation, I have come across a unique layout issue that seems to only affect Firefox. It appears that elements with display:table-cell; do not act as the positional parent for descendants with position:absolute;. It is surprising to discover th ...

Creating a Gradient Effect for Partial Next Slide on Slick Slider using Bootstrap 4

I am currently designing a responsive carousel using Bootstrap-4 and slick.js. With the center-mode enabled, I noticed that it shows a partial next slide. I am interested in adding a gradient to this partial next-slide, but I am uncertain about how to acco ...

Menu with full-width navigation and dropdown options

I am trying to create a navigation menu with a black background that spans the full width of the window. To achieve this, I have placed the ul element inside a div with overflow: hidden; set. However, I am facing issues where hovering over submenus causes ...

"Selecting elements with CSS using the 'element'

While exploring some websites for studying purposes, I came across this code snippet. .site-header .widget-area span.but As a beginner in CSS, I'm curious to know more about the span.but part. Is it similar to the :not pseudo selector? ...

What is the best approach for scaling @material-ui Skeleton in a grid row with variable heights?

I am working on creating a grid of Avatar images with a transition state where I want to show a skeleton representation of the image. To achieve this, I am using @material-ui/lab/Skeleton. The issue I'm facing is that since my images are set to autos ...

Move the Material UI popover to the clicked icon's position

I am looking to create a popover similar to the image linked below. When the icon is clicked, I want the popover to display with the same user interface. Here is the code snippet that I have been using: {showPopOver && ( <Popover ...

Cannot render <Image> inside <Section> component

As a beginner in React, I am attempting to create an app following a tutorial. In my component, I utilized the figure tag but it's not showing up when inspecting element in Chrome. Here are the code snippets: The tutorial includes a div tag as a chil ...

Is the space-between property not delivering the desired spacing?

I am trying to achieve equal spacing between list items, and I attempted the following code. ul { list-style-type: none; display: flex; justify-content: space-between; } However, it seems that this approach is not working as expected. I am confused ...

Troubleshooting a CSS problem on a table filled with images - See attached screenshots for

I've been working on a project involving my phpmyadmin database generating a series of 6 images on my website. I've placed them in a table, but now I'm facing some challenges - even though it seemed simple at first! The goal is to display t ...

Using SCSS to target a sibling class when hovering over an element with CSS

Is there a way to alter styles of a sibling element on hover using only CSS? I attempted something similar but was unsuccessful. HTML: <ul> <li class="item active">name1</li> <li class="item">name2</li> <li clas ...