When I tried to address one issue, my CSS ended up breaking. Any suggestions on how I can resolve the header

Edit:

https://i.sstatic.net/kVeHk.jpg

Picture 1 code:

main.css


body {
    font-family: arial;
    font-size: 14px;
    color: #1D2130;
    background-image: linear-gradient(top, rgb(200,225,245) 15%, rgb(240,240,240) 60%);
    // more CSS properties here
}
#main-body {
    height: 1000px;
    width: 60%;
    // additional styles for main body
}
// more CSS rules...

https://i.sstatic.net/GPQad.jpg

Picture 2 code:

Main.css


body {
    font-family: arial;
    font-size: 14px;
    color: #1D2130;
    background-image: linear-gradient(top, rgb(200,225,245) 15%, rgb(240,240,240) 100%);
    // more CSS properties here
}
// more CSS rules...

index.html (pretty much the same for both pages)


<!DOCTYPE html>
<html lang="en" class="no-js" ng-app="developerBlog">
<head>
    // head section content here
</head>

<body ng-controller="BlogController as blog">

<svg class="hidden">
    <defs>
        <path id="tabshape" d="M80,60C34,53.5,64.417,0,0,0v60H80z"></path>
    </defs>
</svg>

<header>
    // header content here
</header>

<div id="content-wrapper">
      <div class="inner clearfix">
          <section id="main-content">
              <div class="tabs tabs-style-shape">
                  <nav>
                      <ul>
                          <li>
                              <a href="#section-shape-1">
                                  <span>Start</span>
                              </a>
                          </li>
                          // more list items for tabs
                      </ul>
                  </nav>
                  <div class="content-wrap">
                      <section id="section-shape-1">
                          <start></start>
                      </section>
                      // more sections for different tabs
                  </div>
             </div>
         </section>
      </div>
</div>

<script src="javascripts/cbpFWTabs.js"></script>
<script>
    (function() {
        [].slice.call( document.querySelectorAll('.tabs') ).forEach(function(el){
            new CBPFWTabs(el);
        });
     })();
</script>

</body>
</html>

Previous post:

AngularJS - Loading my directives suddenly not working?

Website:


If you need further assistance with fixing the issue, feel free to provide more details about the problem you are experiencing. Learning from experience is a great way to improve your CSS skills!

Answer №1

Your design choices could use a little improvement ;)

To fix your header, simply apply the following CSS:

header {
   width: 950px;
   height: 150px;
}

Alternatively, for a more flexible solution, set the height to auto:

header {
   width: 950px;
   height: auto;
}

If you want to center align your header:

header {
   width: 950px;
   height: auto;
   margin: 0 auto;
}

And one last touch :D For your header's bottom text, try this:

header h2 {
  text-align: left;
  font-size: 16px;
  top: 38px;
  font-family: Impact, Times, arial;
  text-transform: uppercase;
  margin-top: 15px;
  position: relative;
}

Answer №2

Your header on the website http://danieboy.github.io/ has a fixed height and width (row 30 in main.css). Simply remove that and it should function correctly.

For the webpage http://danieboy.github.io/bmi-calculator/index.html, make sure to set both the width and height of your header to auto for it to work properly.

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

Detecting resolutions on an iOS Simulator using PhoneGap

As a newcomer to the world of development, I am diving into the process of creating iOS apps using Phonegap. To accommodate different resolutions, I have developed four separate CSS files. <link rel="stylesheet" media="only screen and (max-device-width ...

Swift: NSAttributeString generates unexpected HTML output

I attempted to use NSAttributeString to parse HTML, but encountered a problem when trying to display a table within a list item. <ol> <li>first <table> <tbody> <tr> ...

Using javascript to save the contents of a textbox as cookies, then displaying the result

I am a beginner in the world of JavaScript and I am looking for an easy solution. Can someone please guide me on how to store the values entered in two text boxes on one HTML page, and then display them on another HTML page? ...

Error Encountered in MERN Stack Development: TypeError Thrown Due to Inability to Convert Undefined

Currently, I am following the MERN Stack, Front To Back Course by Traversy Media. I am in the process of setting up the login functionality for the application. Despite ensuring that my code matches his exactly, I am encountering an error: TypeError: Canno ...

Is it possible for me to enhance Object, Function, Date, and other similar entities in Node by adding "static methods"?

When creating a Node.js module called "augs" that includes: Object.foo = "bar"; And then entering the following commands in the REPL: require("./augs"); typeof Object.foo The result returned is 'undefined'. In our web application, we have a ...

Guide on populating a table with user input using jQuery and ajax

For the past few days, I've been attempting to populate a table using jQuery and ajax based on search results, but unfortunately, it's not working out for me. Below is the HTML code snippet: <form class="form"> <div class="form-gro ...

Arrange the columns of the table in ascending or descending order

I am currently working on a table that has the functionality to sort columns in ascending/descending order when clicked. However, I want each column to retain its previous sorting state and switch to the opposite order when clicked again. For example, if I ...

The absence of the object's shadow is conspicuously noticeable - three.js

View Screenshot Hey there! I recently exported a 3D model tree from Blender and everything seemed to have gone smoothly, but I encountered an issue. The shadow appears on the trunk and branches, however, it is not reflecting properly. Could this be due to ...

What steps can I take to stop Firefox from automatically adding vertical scrollbars to a select dropdown when I change the background color?

Having an issue with changing the background color of a select dropdown. It works fine in Chrome and Safari, but when I try to change the background color in Firefox to anything other than #FFFFFF, the appearance of the dropdown changes drastically. It see ...

The error message "TypeError: Cannot access the tapAsync property because it is undefined"

"webpack": "^7.89.0", "webpack-cli": "^6.2.8", After updating webpack to the versions above, I encountered this error: clean-webpack-plugin: /home/itrus/react/living_goods/build has been removed. TypeError: Cannot r ...

How can I utilize columns from a junction table in the "where" clause in sequelize?

Looking to execute a Sequelize query on multiple related models: SELECT Cou.country_id, cou.country_name, Sta.state_id, Sta.state_name, Dis.district_id, Dis.district_name, Cit.city_id, Cit.city_name, Loc.location_id, Loc.location_name, Sub_Loc.sub_locatio ...

Transferring data between two distinct programs linked to a single router without internet connection using JavaScript and Electron

I am currently working on implementing a feature called 'add monitors' into my program. This feature would allow users to display data on another computer (a sub-program) within the same building, without the need for internet connectivity. The t ...

Using node.js to send custom data over a websocket

I came across an excellent tutorial on websockets. In this tutorial, the server decodes and writes a message to the console whenever it receives a message from the client. After that, the server sends the message back to the client. var firstByte = data ...

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: ...

Having trouble capturing a photo from webcam using HTML5 and getUserMedia() in Google Chrome upon initial page load

Using the information from an article on HTML5Rocks, I am attempting to create a tool that can capture photos from a webcam. Here is an excerpt of my HTML code: <button type="button" name="btnCapture" id="btnCapture">Start camera</button>< ...

Dividing a string in JavaScript to generate fresh arrays

I am currently dealing with the following string: "ITEM1","ITEM2","ITEM3","ITEM4","ITEM5","ITEM6","ITEM7"~100000000,1000048,0010041,1,1,1,1~100000001,1000050,,2,0,2,1~100000002,1068832,0 ...

I am having trouble getting the graph to display using PHP and MySQL on Fusion Charts

I am looking to create a line graph based on data from my database. This is my first time working with Fusion Charts, so I followed the instructions in their documentation for dynamic charts. Here is the code from my PHP page: <?php include("Includes/F ...

Code displayed on Facebook when sharing a website link implemented in JavaScript

Is there a way to prevent javascript code from appearing in Facebook posts when sharing links, whether it's done manually or through programming? I'm specifically looking for solutions to fix my website so that when I post links on Facebook, the ...

Updating Angular model remotely without relying solely on the controller

I am struggling to call the addRectangleMethod method from my Javascript code in order to retrieve server-side information into the Angular datamodel. However, I keep encountering an error stating that the method I'm trying to call is undefined. It&ap ...

Steps for showing the text entered into the input box as soon as it is typed:

I am attempting to create a feature where text is displayed as soon as it is typed into an input box. Currently, my JavaScript function is not working at all. I simply want the function to display text when it is typed into or erased in the text boxes. & ...