Solved

Left menu with a header image

Posted on 2016-10-03
6
45 Views
Last Modified: 2016-10-19
I need to create something that looks like this
---------------------------------------------------------------------------------------------
| Menu Item 1     | Image                                                                     |
| Menu Item 2     |                                                                                 |
| Menu Item 3     |                                                                                 |
| Menu Item 4     |                                                                                 |
---------------------------------------------------------------------------------------------

I can't figure out how to display the menu items and still have the image for the logo displayed to the right.
0
Comment
Question by:breeze351
  • 2
  • 2
  • 2
6 Comments
 
LVL 42

Accepted Solution

by:
zephyr_hex (Megan) earned 500 total points
ID: 41827088
Create a container div, and then two child divs inside that container div.  The first div holds the content of the menu items, and the second div holds the image.  Then style the first child div to float left.

Here is a Fiddle Demo.

HTML
<div id="container">
  <div id="menu">
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
    </ul>
  </div>
  <div id="image">
    <img src="http://findicons.com/files/icons/1995/web_application/48/smiley.png"> </div>
</div>

Open in new window


CSS
#menu {
  float:left;
}

Open in new window

0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41827153
You can also make the image a background-image of the menu item and position it right-center.
0
 

Author Comment

by:breeze351
ID: 41830514
Zeph
No Joy.  I copied your code and tried it.  The image appears below the menu!

<!DOCTYPE html><head>
	<title>Menu</title>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" href="Fred.css">
</head>


<div id="container">
  <div id="menu">
    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
    </ul>
  </div>
  <div id="image">
    <img src="Images/Lang_Logo.jpg"> </div>
</div>

Open in new window


Fred.css
#menu {
  float:left;
}

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:Kim Walker
ID: 41830528
There must be a conflict with other styles. What is the base URL of your Fred.css and Images/Lang_Logo.jpg files? Or better yet, what is the URL to your test file if it's available remotely?
0
 
LVL 42

Expert Comment

by:zephyr_hex (Megan)
ID: 41840996
Were you able to locate the conflicting CSS?  If not, can you set up a Fiddle Demo that demonstrates the problem?
0
 

Author Closing Comment

by:breeze351
ID: 41851094
Got it thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now