Results 1 to 8 of 8

Thread: [RESOLVED] More CSS problems :( (Resolved Again)

  1. #1

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Resolved [RESOLVED] More CSS problems :( (Resolved Again)

    Ok went looking for some examples on how to make my website look cooler. I found a css example that was pretty simple and looked neat. Just a basic change of a hyperlinks background color on hover. Here's the code in the css page.

    Code:
    	ul
    	{
    		float:left;
    		width:100%;
    		padding:0;
    		margin:0;
    		list-style-type:none;
    	}
    	a
    	{
    		float:left;
    		width:6em;
    		text-decoration:none;
    		color:White;
    		background-color:Navy;
    		padding:0.2em 0.6em;
    		border-right:1px solid white;
    	}
    	a:hover {background-color:Black}
    	li {display:inline}
    My problem is that now i want to do a different kind of hyperlink on the same page, but i keep getting this style. I'm trying to create a seperate menu on the left that will be full of hyperlinks but i'd like them to be a different still. I put the links in a component and then dropped them on the page but i still get the same style. If you can point me in the right direction i'd appreciate it.

    Thanks
    Andy
    Last edited by space_monkey; Apr 7th, 2006 at 11:27 AM.
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  2. #2
    Hyperactive Member kayos's Avatar
    Join Date
    Apr 2004
    Location
    Largo, Florida
    Posts
    306

    Re: More CSS problems :(

    add a class to your origional hyperlink like this:

    a.nav <- nav being the class
    {
    /*blah*/
    }
    a.nav:hover <- still nav class
    {
    /*blah*/
    }


    If this post helps, please RATE MY POST!

    Using Visual Studio 2005 SE

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: More CSS problems :(

    Just create a new class for your "new" area that you want to apply the style to and provide the styles for the anchor accordingly. Then apply it to the desired anchors or elements.


    Example use:
    <a href="#" class="login" blah....


    VB Code:
    1. .login a {
    2.     background-color: #cccccc;
    3. }
    4.  
    5. .login A:link, .login A:visited {  
    6.     text-decoration: none;
    7.     color:  #b22222;
    8.     }      
    9.            
    10. .login A:hover  {  
    11.     text-decoration: underline;
    12.     color:  #000000;
    13.     }
    14.    
    15. .login A:active {  
    16.     background-color: #cccccc;
    17.     text-decoration: none;
    18.     color:  #b22222;
    19. }
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: More CSS problems :(

    Freaking sweet guys. Thanks!

    One day i might get the hang of this web site gui stuff.
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  5. #5

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: More CSS problems :( (One more question)

    Ok i've made the changes that guys recommened and it worked fine for the component. But when i drop that on to the form it seems like it forgets what i told it. Is that normal? The wierd thing is that it remembered what i set the background color too but forgot everything else. Any insight?
    Last edited by space_monkey; Apr 7th, 2006 at 10:58 AM.
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  6. #6

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: More CSS problems :( (One more question)

    Well i was wrong its not seeing any of the formatting from the component, that is in the CSS. I can manually change the component and that will be reflected in the form but the css styles don't seem to be transfering for this control. But it is for the other two.
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: More CSS problems :( (One more question)

    I see your running 2005 so I can only assume since I have 2003 currently.

    What does the source code look like? Is the class name specified in it? Are you also using additional styles on it?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: More CSS problems :( (One more question)

    w00t i think i got it. I left out my <ul> tag with the class... Thanks anyway
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width