Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    1
    Member #
    41448

    HTML not using my css file

    Hi everyone, I'm new to this site and building sites, so I appreciate any help at this point. I'm going nuts here and have used what I've learned through classes and books. But the stylesheet isn't being completely used by my html. I see that it works for some parts, but not all and I'm at a loss. For one, I've set my <div> to use a container class in my css, I used the appropriate name, checked the tags, etc. but it doesn't use it whatsoever:

    HTML:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Welcome to Punkie Designs</title>
    <link href="mystyles.css" rel="stylesheet" type="text/css" />
    <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>

    </head>

    <section id="actions">
    <div class="container">
    <h1>Welcome to Punkie Designs</h1>
    <p>I'm currently in the process of building my site.<br>
    Please check back soon!
    </p>
    </div>

    CSS:
    actions {
    background-color: #ffffff;
    border-top: 6px solid #51a3b4;
    padding: 5px;
    margin-bottom: 15px;
    }

    container {
    max-width: 740px;
    width: 90%;
    }

    Another issue I'm having is the necessary tags for <nav>. It uses part of the style I set up in my css, but the hover part isn't working:

    HTML:
    <nav>
    <a href="#" role="button" ng-click="toggle()">Contact Info</a></nav>
    <table style="width 100%" ng-hide="myVar">

    CSS:
    /* Styles for <a> tags for buttons */
    nav a {
    background-color: #51a3b4;
    color: white;
    text-decoration: none;
    outline: none;
    padding: 10px 0;
    display: block;
    float: center;
    border-bottom: 4px solid #062b4d;
    border-radius: 5px;
    width: 10%;
    text-align: center;
    box-sizing: border-box /* for older browsers */
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    }

    /* Unvisited and visited styling */
    nav a:link, nav a:visited {
    background-color: #51a3b4;
    color: white;
    }

    /* Styling for hover and tap */
    nav a:hover, nav a:active {
    background-color: #7a7a7a
    color: black;
    -webkit-transition: background-color 0.2s ease;
    -moz-transition: background-color 0.2s ease;
    -ms-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
    }

    Crazy, but the AngularJS I set up works fine. LOL!! Again, any help at this point would be greatly appreciated!!!

  2.  

  3. #2
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times
    You're missing the dot in front of class name in your css.

    actions {
    backgro...

    should be:
    .actions {
    backgro...

    The same for container:
    .container {


    Hover is maybe overwritten somewhere or Angular is overwriting it, as you have role="button" set in A tag. Try to remove it to see what will happen

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Actually, "actions is an id , so it should be #actions in the CSS, container is a class, so should have the "." before the word like so: container.

    I think you may find it useful to read about CSS at CSS Tutorial Start at the beginning and pay attention to the chapters on syntax and selectors. Move forward from there, and make use of the testing area so you can see how things work.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com