473,837 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to float a menu on the right within a div?

Hi,

I have a div to provide a background image for a menu. I'd like to position
the menu on the right side but I can't seem to find a right way of doing it.
The only way the menu will move to the right if I set text-align=right in
the div. The problem is that menu items are then also aligned on right
side. Not only that but this alignment works only in IE.

Could someone please let me know how to right-align the menu?

Menu:
<div id="menuArea">
<asp:Menu ID="topMenu" runat="server" Orientation="Ho rizontal"
StaticEnableDef aultPopOutImage ="false"
DataSourceID="d sSiteMap">

<StaticMenuItem Style CssClass="stati cMenu" />

</asp:Menu>
<asp:SiteMapDat aSource ID="dsSiteMap" runat="server"
ShowStartingNod e="False" />
</div>

CSS:
#menuArea
{
background-image: url(Images/header_menu.gif );
background-repeat: no-repeat;
clear: both;
padding-right: 10px;
padding-left: 0%;
font-weight: normal;
font-size: 0.8em;
float: none;
padding-top: 0%;
padding-bottom: 0%;
margin: 0%;
color: #477897;
width: 720;
height: 39px;
/*text-align: right;*/
}

..staticMenu
{
background-color: Transparent;
float: right;
}

Thanks,
Bogdan

Jun 27 '08 #1
1 5562
I found the problem. I had <StaticMenuItem Styleplaced twice (not shown in
my original post) instead of <StaticMenuStyl eand <StaticMenuItem Style>. I
thought I'd save some time by copy 'n paste but instead burnt few hours.
Lesson learned.

Bogdan
"bogdan" <bo****@nospam. comwrote in message
news:eE******** *****@TK2MSFTNG P05.phx.gbl...
Hi,

I have a div to provide a background image for a menu. I'd like to
position the menu on the right side but I can't seem to find a right way
of doing it. The only way the menu will move to the right if I set
text-align=right in the div. The problem is that menu items are then also
aligned on right side. Not only that but this alignment works only in IE.

Could someone please let me know how to right-align the menu?

Menu:
<div id="menuArea">
<asp:Menu ID="topMenu" runat="server" Orientation="Ho rizontal"
StaticEnableDef aultPopOutImage ="false"
DataSourceID="d sSiteMap">

<StaticMenuItem Style CssClass="stati cMenu" />

</asp:Menu>
<asp:SiteMapDat aSource ID="dsSiteMap" runat="server"
ShowStartingNod e="False" />
</div>

CSS:
#menuArea
{
background-image: url(Images/header_menu.gif );
background-repeat: no-repeat;
clear: both;
padding-right: 10px;
padding-left: 0%;
font-weight: normal;
font-size: 0.8em;
float: none;
padding-top: 0%;
padding-bottom: 0%;
margin: 0%;
color: #477897;
width: 720;
height: 39px;
/*text-align: right;*/
}

.staticMenu
{
background-color: Transparent;
float: right;
}

Thanks,
Bogdan

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7647
by: Ian Watts | last post by:
I am trying without success to understand what is going on. I am developing a site at http://www.ianwatts.info/edensor/ http://www.ianwatts.info/edensor/edensor.css and I have two problems. 1. I want the text (The Best Lesson of the Week) to sit at the right
4
5787
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
6
5352
by: Jim Lawton | last post by:
I am trying to achieve a simple page layout using only divs and css. I know that people bad mouth IE for non-conformance, but in this case IE's(6.0)behaviour is entirely the way I expect, and Gecko (Firefox/1.0) is, well, not. I have a left menu div, and a right content div, float left, the width of which is auto. My intention is that the content should fill the space to the right of the menu. In IE putting a float right div in the...
0
2059
by: jonipony | last post by:
HELP: Float Left box is drifting to the right in ie! -------------------------- I need som HELP with my CSS coding! On the following web page my design falls apart at screen size 800 x 600 (looks fine at larger screen sizes) when the left menu box that should float left is drifting to the right in Internet Explorer 6.0 (it doesn't drift to the right in Netscape 7.1).
14
4995
by: Mark | last post by:
please view http://mnbayazit.com/misc/sample.gif i'm wondering how i can make the sidebar (green) float to the right of the main text, without specifying the width of the main content (because the sidebar is optional, i need the main content to fill the space available). ie, the green sidebar should be right up against the red header. code below
3
1773
by: hantechs | last post by:
<html> <body> <p style="width:30%;">text1</p> <p style="float:left;">text2</p> </body> </html> The effect of this html code is : text1 and text2 each is on a line. My question is: Why text2 is positioned on the right of text1? Because the CSS2.1 said: A floating element must be placed as high as possible; A left-floating element must be put as far to the left as possible; A
22
51577
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the next line. What am I doing wrong? TIA.
5
15592
by: John | last post by:
Hi Suppose I want a header containing an image floated left and a list of horizontal links floated right. So I float the image left. I then do the following with the list: ul = float: right li = display: inline li a = display: block; float: left
2
3384
by: comedyboy19 | last post by:
hey guys, so i am editing the header section of my website and for some reason there is an issue with the logo and header section. Whenever i float the logo to the right side of the header the bottom border jumps to the top. i dont know why this is happening. this is the style.css code #header{ position: relative; width: 100%;
0
9837
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
10870
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10621
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10267
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5668
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4038
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3123
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.