CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/2/2007 7:22:04 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 7 Views: 57 Favorited: 0 Favorite
8 Items, 1 Pages 1 |< << Go >> >|
Pants
Asp.Net User
Menu staticSubmenu text wrap not aligning propely8/2/2007 7:22:04 PM

0

I have created a vertical menu control on a master page with 2 static display levels that is pulling its data from a sitemap data source. Due to the formatting of the page I have restricted the width of the menu. This was done in CSS. To be more precise, the "sidemenu" exists within a "Sidebar" <div> that contains all of the objects in the sidebar, which includes news updates, links etc... The width of the menu is being limited by the width of the sidebar <div>.Some of the items of the second static display level, or the staticSubmenu have text that wraps (which I like), but the first letter in the second line of text is not aligning with the first letter in the first line of text. Below I will provide the relevant code from my .master page as well as my CSS file. Please let me know if any additional code snippits are required, and thank you in advance for any help. I have also included a screenshot to illustrate the undesired behavior.

Code from appmaster.master

<div id="sidebar">

<div id="sidemenu">

<asp:SiteMapDataSource runat="server" ID="SiteMapDS2" ShowStartingNode="true" />

<asp:Menu ID="sideMenu" runat="server" DataSourceID="sitemapDS2" StaticDisplayLevels="2" Orientation="Vertical" OnPreRender="sideMenu_PreRender" StaticSubMenuIndent="0px" ItemWrap="true">

</asp:Menu>

</div>

 ..... other items in sidebar

</div>

Code from CSS file, I have regurgitated some of it from the main menu which is displayed horizontally accross the top of the screen. Also, I was using the "Personal" design template available for download from Microsoft to utilize the "Jello Mold" design technique. So far I have had fun learning how it works, as well as modifying and manipulating it for my own needs.

#sidebar {

width: 130px;

float: left;
display: inline; /* IEwin doubled margin bug fix */

margin-left:-3px; /*IE Win 3px gap fix*/

background-color:#DEDEBC;

background-image:url(Images/sidebar_bg.png);

background-repeat:repeat-y;

}

html>body #sidebar {margin-left:0;}#sidemenu, #sidemenu tr

{

z-index:0;

position:relative;

background-color:#DEDEBC;

color:#D3D3A7; margin-left:0px;

}

* html #sidemenu {margin-top:-1px;}

#sidemenu a {text-decoration:none;}

/* Adds a height to a button so that IE Win will allow it to be clickable across its full width. */

/* Hide from IE5-Mac \*/

* html #sidemenu a {height: 1%;}

/* end hiding */

#sidemenu .normallink {

padding:0 10px;

font-weight:bold; color:#FFFFFF;

}

#sidemenu .selectedlink {

padding:0 10px;

background-color:#DEDEBC; color:#397D47;

}

#sidemenu .dynamiclink { /* background-color:#DEDEBC;

*/

}

#sidemenu .dynamichoverlink {

background-color:#DEDEBC;

color:#397D47;

}

Screenshot of output to page. Notice the line "Public Comment Rules" and how the word "Rules" is further left thatn the rest of the text. Any ideas?

 

 

 

 

 

 

Pants
Asp.Net User
Re: Menu staticSubmenu text wrap not alligning propely8/3/2007 12:08:37 PM

0

Interestingly enough if I right align the text within the menu, I get a similar problem, notice in the screenshot how now the last letter in the first line is extended beyond all the other text.... I have also included the code from the CSS file, no other code has changed to date.

 Again, any help would be much appreciated.

 

 #sidemenu, #sidemenu tr

{

z-index:0;

position:relative;

background-color:#DEDEBC;

color:#D3D3A7;

margin-left:0px;

text-align:right;

}

Pants
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 12:23:12 PM

0

Another interesting phenominon, while trying to work this out, I set the text indent to 15px, it would appear as though when the text wraps, it is immune to any and all formating via the CSS, notice in the screenshot how all of the text is indented further, but the text that wraps is not changed AT ALL.

 

#sidemenu, #sidemenu tr

{

z-index:0;

position:relative;

background-color:#DEDEBC;

color:#D3D3A7;

margin-left:0px;

text-align:left;

text-indent:15px;

}

Adam.Kahtava
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 3:38:26 PM

0

text-indent only indents the first line of text in your element - what you are seeing is the correct behavior. What are you using to debug your CSS design? Have you tried using Firebug for Firefox? Firebug is the best Web Design / CSS / DOM debugger I have come across yet.


-Adam Kahtava [http://adam.kahtava.com]
Adam.Kahtava
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 3:43:45 PM

0

Are you using the overloaded Menu control from the ASP.NET 2.0 CSS Friendly Control Adapters 1.0 or are you using the standard ASP.NET Menu?


-Adam Kahtava [http://adam.kahtava.com]
Pants
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 4:06:12 PM

0

Thank you, I am looking into Firebug now. I am at a new  job and haven't even installed Firefox yet!!! So I will be doing that at the same time as well.....

Also thank you for the tip that this is the default behavior... but I get the problem, per my first post, with an indent of 0, so why is it going further left than all of the other text? It is good to know that this is the default behavior for indent, is there another property that I can set that will properly align all of the text on the LHS?

 I am currently using the standard .NET 2.0 Control, I will also look into the overloaded CSS Friendly Control Adapters.

 Additionally, I have rectified the problem my setting the text to allign centered, which is a work around that I decided on because I was too frustrated with it... nevertheless, I would like to get the formatting proper without "settling" on a workaround.

Adam.Kahtava
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 4:22:01 PM

0

Once you install Firebug for Firefox you can click on the effected element and see how the CSS styles are computed in your web browser. At this point you should be able to make the appropriate changes to your Styles and get your alignment on the LHS correct.

I noticed a couple CSS hacks in your Style Sheets, you may want to consider building on the CSS provided from the Menu Control in the CSS Friendly Control Adapters. Then you could make the appropriate modifications. CSS hacks are generally not recommended and should be a last resort, often times we can use Conditional Comments in place of the hacks, this offers a nicer approach to targeting CSS to different browsers. 


-Adam Kahtava [http://adam.kahtava.com]
Pants
Asp.Net User
Re: Menu staticSubmenu text wrap not aligning propely8/3/2007 8:31:14 PM

0

Thanks for your help.

Using firebug I was able to isolate the problem to the part of the CSS where I specify the formatting for the "Normal" and "Selected' links, I had originally put in some padding on the left, which I suppose, like the indent property, was only applied to the fist line of text. After removing the padding the text is all aligned as I would like it. To achieve an overall "indent" I applied a margin to the menu control and now I get the desired look and feel.

 Also, the CSS hacks were given to me my Microsoft to achieve the fluid layout that I desired as well as providing cross platform functionality. According to Microsoft they are necessary to acieve the fluid layout in IE.

 Thank you again.

 

 

8 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Using Css with the Menu Control - ng.asp-net-forum ... menu staticsubmenu text wrap not aligning propely · issue with master page and css · how to create sitemap in asp.net ...

ASP:Menu Control & CSS... IE & Firefox Display Differently. Help ... menu staticsubmenu text wrap not aligning propely · compilation error cs0030: cannot convert type 'masterpage.masterpage' to ...
LoginView - How do I access controls from JavaScript? - ng.asp-net ... menu staticsubmenu text wrap not aligning propely · master pages - javascript relative path problem · doing postback from master page to page in master's ...
how to take row in gridview - ng.asp-net-forum ... menu staticsubmenu text wrap not aligning propely · master pages and seo for the complete novice · can't view any of the wizardsteps other than first from ...






couple of questions.. forum vs forum, custom skins

portal like container page

terms of use is a broken link

not working: mobile dotnetnuke

how to remove /dotnetnuke from the address site

dnn 2.1.2 - deleted module definition - now site unaccessible

firebird and skinning..

how best to setup clientside code?? (module dev, 3.x)

dnn 3.0.8, error in module

adding a mdoule for version 2.04

dotnetnuke's built in paypal - how do you implement it.

module definitions page

new control panel issue

siteurls.config secret

dotnetnuke.com upgraded?

two domains pointing to the same dnn application

why does deleting a mod def mean del mod folder?

dnn sites

admin tab and module controls

change portal from child to parent

need clue to debug 2.0 pa

clustering web server

automate child portal creation

3.0.x issue - invalid object name

portal alias problem

file manager - rename / synch v3.0.13

rdp web page

dnn 2.0.3 -- build errors after a clean install

deployment

installation: the specified module could not be found.

   
  Privacy | Contact Us
All Times Are GMT