Trouble with alignment of text in two rows using Div/text - a simple fix needed

I'm currently facing some challenges with a simple task, due to being new to web design and system administration. My boss requested two phone numbers instead of one in the top box, and I need them aligned while keeping the "free estimate" button in place.

I tried using a DIV with relative positioning, but it's not pushing the main header menu bar down as expected.

CSS:

#head {
    float: right;
    width: 500px;
    height: 79px;
    font-size: 1.5em;
    padding-right: 27px;
    padding-bottom: 6px;
    display: block;
    position:relative;
}
#head1 {
    width: 450px;
    float: left;

    font-family: kreon;
    font-size: 1.3em;
}

h1 {
    font-size: 1.6em;
    color: #FFFFFF;
    font-family: kreon;
    text-shadow: 2px 1px 1px #000;
    -webkit-font-smoothing: antialiased;
}


.header {
position: relative;

}



.container {
    width: 1030px;
    margin: 0 auto; 
    z-index: 2;
}

.header {
position: relative;

}

HTML:

<div class="container">
  <div class="header">
    <div id="head1">
      <h1>Safer Products, Better Results!</h1></div><div id="head">
      <h1><img src="topbutn.png" width="182px" height="33px" alt="topbtn"> (618) 632-8873
<br>(636) 272-8873 </h1>
    </div>
  <img src="/mainbar2.png" alt="main" name="Nav Bar"
   border="0" usemap="#Map" id="bar">
      <map name="Map">
        <area shape="rect" coords="33,20,231,159" href="/index.html" alt="Lawn and Landscaping from the pros!">
        <area shape="rect" coords="862,31,949,145" href="/paybal.php" alt="">
        <area shape="rect" coords="741,33,847,148" href="http://www.facebook.com/pages/Tee-Time-Lawn-Care/173861472673451" alt="Expert Advice Blog">
        <area shape="rect" coords="626,33,722,146" href="/landscaping.html" alt="Landscaping services">
        <area shape="rect" coords="516,31,614,146" href="/pestcontrol.html" alt="Pest control">
        <area shape="rect" coords="395,31,508,146" href="/trees.html" alt="Tree and shrub Services">

        <area shape="rect" coords="275,32,379,147" href="/lawncare.html">
      </map>

    <!-- end .header -->
  </div>

Answer №1

Delete the height specification from the #header section.

#header {
float: right;
width: 500px;
height: 79px; /* DO NOT INCLUDE THIS LINE */
font-size: 1.5em;
padding-right: 27px;
padding-bottom: 6px;
display: block;
position: relative;
}

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

Verification of postal codes on websites for cities and countries

Currently exploring options for adding a postcode/zip code verification feature to the "contact us" page. The idea is for users to choose a country and/or city, with the system then displaying or confirming the appropriate post/zip codes based on valid o ...

Showing the content of an email's HTML Body

In developing my Python Django website, I'm looking to showcase emails on the front end. These emails have already been processed in the backend and are retrieved via AJAX in JSON format. My main concern is displaying the HTML body of these emails wi ...

The table row disappears but the value persists

I have designed a table where users can perform calculations. However, when a row is deleted, the values from that row appear in the row below it and subsequent rows as well. What I want is for the user to be able to completely remove a row with its values ...

The jsonGenerator is unable to process strings containing spaces

Hey, I'm having trouble passing a string with whitespaces to my JavaScript function using jsonGenerator. Here's the code snippet: jGenerator.writeStringField(cols[8], ap.getContentId() != null ? "<img src='img/active.png' onclick=au ...

Output the name of the file while executing the ant process

Currently, I am utilizing YUI compressor within an ant build process to compress CSS and JavaScript files. I would like the compressor to display the name of each file it is processing as it goes along, so that in case of an error, I can easily pinpoint wh ...

What is the technique to enable this div to be clickable?

I am trying to make each "card" of a WordPress plugin clickable on my website. I have inserted a Pure JS element with the following code: document.getElementsByClassName('fc_card-container').onclick = function() {alert('It works!');} ...

Tips for updating or toggling an icon within a button with the help of Bootstrap 5 and jQuery

Looking to switch the icon displayed inside a button upon clicking? The initial icon is <i class="fas fa-bars"></i>, and after being clicked, it should change to <i class="fas fa-times"></i>. How can this be ach ...

Animating a CSS overlay

My goal is to design an overlay using the following HTML and CSS code snippets div.relative { position: relative; width: 400px; height: 200px; border: 3px solid #73AD21; } div.absolute { position: absolute; top: 50%; right: 0; width: 20 ...

Utilizing jQuery to Maintain State Across Page Refreshes with Cookies

Currently, I am attempting to create a script that can retain its state even after the page is refreshed. Here is my progress so far: Utilizing jQuery: $(window).ready(function() { var voteId = $('.gallery-item a'); $(voteId).click(function() ...

Adjust the placement of a small division within a larger resizable division without affecting the contents of the container

Check out this JSFiddle I created: http://jsfiddle.net/asaakius/5nGYS/7/ In the code, you'll see a small div with the id #menu containing the letter "v". When I remove this div, the textarea and textbox align perfectly and resize together seamlessly. ...

Issue with the dimensions and proportions of the canvas

After creating a canvas with HTML and setting the ratio to 16/9 in the CSS, I specified a width of 100vw and added a border. However, I noticed that the canvas appeared larger than expected on the screen. #canvas{ width: 100vw; aspect-ratio: 16/9; border: ...

What is the method to programmatically trigger the highlight effect (similar to mouseover) in Javascript or JQuery?

In the process of creating an interface that features a list of large buttons, I am interested in implementing functionality to highlight a button based on the movement of the mouse. Essentially, I would like the button below the currently highlighted butt ...

Tips for adjusting HTML files prior to HTMLOutput in Google Apps Script

I'm looking to make some changes to an HTML file within the doGet() function before it's output in HTMLOut. However, I'm running into an issue with the <?!=include('css').getContent();?> code snippet, as it can't be exec ...

html nested table with merged columns

I've come across this issue before, but I just can't seem to figure out how to implement a multi-layered colspan in an HTML table. The HTML table I'm working with is from w3schools, but I want to create a colspan of 2 for Data 2 and Data 5. ...

Is there a way to ensure that the JSON data and the image appear on the same row with some spacing between them?

Trying to display JSON data with images and text side by side but facing issues where the text wraps below the image instead. How can I fix this layout to show text next to the image? Flex-wrap property doesn't seem to work as expected. function for ...

changing the visible style of a div element using JavaScript

I'm having an issue with a link on my webpage that is supposed to show or hide a <div id="po" style="display:none;">some html</div> element. The first time I click the link, the div displays properly. However, after tha ...

Do Bootstrap 3 and Bootstrap 4 - alpha versions maintain backward compatibility with each other at present?

Is backward compatibility maintained between Bootstrap 3 and the alpha version of Bootstrap 4? I am attempting to replace Bootstrap 3 with the new alpha version, but I am experiencing broken styles. Is this a common issue or am I missing something in my a ...

Tips for perfectly aligning all elements in a row within a card design

Hi there, I'm trying to figure out how to align the content of this card in a single row instead of stacked on top of each other. Here's the code snippet: <div class="container"> <form onSubmit={submitHandler}> ...

A step-by-step guide on integrating a Django template tag and HTML element into an HTML page using Javascript

Is there a safe way to insert HTML that includes Django template tags using JavaScript in my project? For instance, if my template contains the following code: <div id="some-element"> <span id="my-tag">{{ my_data }}</sp ...

Creating a simulated textarea with a scrollbar and dynamically refreshing the content

Due to limitations on markup content inside <p> tags, I have decided to create my own custom textbox. This textbox will function as a console where the battle progress is logged. Initially, I attempted using nested divs for each log, but encountered ...