Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. putting variables in the html section?

putting variables in the html section?

Scheduled Pinned Locked Moved ASP.NET
htmlquestionworkspace
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dazinith
    wrote on last edited by
    #1

    hey guys and gals.. i am trying to build my site such that i can let the users switch the colors for my tables n stuff.. but i cant get it to compile, so i thought i would ask for a suggestion.. in global.asax file

    // setup colors
    Application["colors_SubMenu"] = "#000099";
    Application["colors_SideBars"] = "#DEEDFE";
    Application["colors_NewsHeader"] = "#CAE4FF";
    Application["colors_NewsBody"] = "#ECF5FF";

    in DailyNews.aspx file

    its the last line there that is trying to put the application color into the bgcolor field of the table tag.. any suggestions are much appreciated!

    still a newb.. cut me some slack :P
    -dz

    ">

    J 1 Reply Last reply
    0
    • D dazinith

      hey guys and gals.. i am trying to build my site such that i can let the users switch the colors for my tables n stuff.. but i cant get it to compile, so i thought i would ask for a suggestion.. in global.asax file

      // setup colors
      Application["colors_SubMenu"] = "#000099";
      Application["colors_SideBars"] = "#DEEDFE";
      Application["colors_NewsHeader"] = "#CAE4FF";
      Application["colors_NewsBody"] = "#ECF5FF";

      in DailyNews.aspx file

      its the last line there that is trying to put the application color into the bgcolor field of the table tag.. any suggestions are much appreciated!

      still a newb.. cut me some slack :P
      -dz

      ">

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      You might want to use cascading style sheets. A cascading style sheet is a file that contains styles you can use on your web page. You don't have to define any particular attribute(s) in your style. Any attribute you don't define will stay the way it currently is, so you can nest styles within each other. That's why it's called Cascading Style Sheets. EXAMPLE: Make a file called MyCSS.css, put it in the same folder as your html file, and put this text in it:

      @media all {
      //anchor style
      A {
      color: #0054BB;
      }

      //active hyperlink style
      A:active {
      color: #D18CE5;
      }

      //hyperlink style
      A:link {
      color: #0054BB;
      }
      //visited link style
      A:visited {
      color: #0084CB;
      }
      // "H1" header style
      H1 {
      }
      //paragraph style
      P {
      font-family: "Times", "Times New Roman", "serif";
      font-size: small;
      font-size-adjust: none;
      color: black;
      background-color: #75D6E5;
      font-weight: bold;
      text-align: center;
      margin-top: 2%;
      margin-left: 2%;
      border-top: 3pt;
      border-bottom: 2pt;
      border-left: 3pt;
      }

        // a custom style
      

      .cTitleHeader {
      font-family: "Times", "Chaucer", "serif";
      font-size: x-large;
      font-weight: bold;
      text-align: center;
      text-shadow: #000000 2px 2px 2 px;
      color: #0000AB;
      background-color: transparent;
      }
      //another custom style
      .cdProdTitle {
      font-family: "Times", "Times New Roman", "serif";
      font-size: medium;
      font-size-adjust: 110%;
      font-weight: bold;
      color: black;
      background-color: #75D6E5;
      }

      }

      to use this style sheet in html, we put this at the top of our page just after the "title" tag:

      To use the style "cdProdTitle, we do this:

      < div class="cdProdTitle" > A Title! < /div >

      And, there it is! The text "A Title!" will be in the style you defined in your style sheet! I used the div tag but you can apply a style to any tag.

      D 1 Reply Last reply
      0
      • J J Dunlap

        You might want to use cascading style sheets. A cascading style sheet is a file that contains styles you can use on your web page. You don't have to define any particular attribute(s) in your style. Any attribute you don't define will stay the way it currently is, so you can nest styles within each other. That's why it's called Cascading Style Sheets. EXAMPLE: Make a file called MyCSS.css, put it in the same folder as your html file, and put this text in it:

        @media all {
        //anchor style
        A {
        color: #0054BB;
        }

        //active hyperlink style
        A:active {
        color: #D18CE5;
        }

        //hyperlink style
        A:link {
        color: #0054BB;
        }
        //visited link style
        A:visited {
        color: #0084CB;
        }
        // "H1" header style
        H1 {
        }
        //paragraph style
        P {
        font-family: "Times", "Times New Roman", "serif";
        font-size: small;
        font-size-adjust: none;
        color: black;
        background-color: #75D6E5;
        font-weight: bold;
        text-align: center;
        margin-top: 2%;
        margin-left: 2%;
        border-top: 3pt;
        border-bottom: 2pt;
        border-left: 3pt;
        }

          // a custom style
        

        .cTitleHeader {
        font-family: "Times", "Chaucer", "serif";
        font-size: x-large;
        font-weight: bold;
        text-align: center;
        text-shadow: #000000 2px 2px 2 px;
        color: #0000AB;
        background-color: transparent;
        }
        //another custom style
        .cdProdTitle {
        font-family: "Times", "Times New Roman", "serif";
        font-size: medium;
        font-size-adjust: 110%;
        font-weight: bold;
        color: black;
        background-color: #75D6E5;
        }

        }

        to use this style sheet in html, we put this at the top of our page just after the "title" tag:

        To use the style "cdProdTitle, we do this:

        < div class="cdProdTitle" > A Title! < /div >

        And, there it is! The text "A Title!" will be in the style you defined in your style sheet! I used the div tag but you can apply a style to any tag.

        D Offline
        D Offline
        dazinith
        wrote on last edited by
        #3

        ah, didnt think of it that way, i guess that makes a bit more sence :) thanks! still a newb.. cut me some slack :P -dz

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups