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. how to use css in asp.net

how to use css in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpcssasp-nettutorial
10 Posts 6 Posters 0 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.
  • R Offline
    R Offline
    Rmesh
    wrote on last edited by
    #1

    i need to know about how to use cssclass of web controls

    A S S T S 5 Replies Last reply
    0
    • R Rmesh

      i need to know about how to use cssclass of web controls

      A Offline
      A Offline
      anuj_24mar yahoo com
      wrote on last edited by
      #2

      in html head part use this line of code

      anujsharma

      1 Reply Last reply
      0
      • R Rmesh

        i need to know about how to use cssclass of web controls

        S Offline
        S Offline
        Sams Den
        wrote on last edited by
        #3

        Hi, Consider you have a style defined in CSS file.. something like: .Style1 { font: 12pt verdana; font-weight:700; color:orange; } you can then use the cssClass like: TextBox id="TextBox1" ForeColor="Red" CssClass="Style1" You can even make use of codebehind file if you want to change it during runtime..but it will be available only for server controls. Hope this helps. Thanks Sameer Sameer

        R 1 Reply Last reply
        0
        • R Rmesh

          i need to know about how to use cssclass of web controls

          S Offline
          S Offline
          sunilkr
          wrote on last edited by
          #4

          first you create stylesheet for a web page. simply, drag and drop stylesheet under page section in asp.net's all controls has class or cssClass attribut. which stylesheets class you want to use you write their name under class or cssClass.

          1 Reply Last reply
          0
          • S Sams Den

            Hi, Consider you have a style defined in CSS file.. something like: .Style1 { font: 12pt verdana; font-weight:700; color:orange; } you can then use the cssClass like: TextBox id="TextBox1" ForeColor="Red" CssClass="Style1" You can even make use of codebehind file if you want to change it during runtime..but it will be available only for server controls. Hope this helps. Thanks Sameer Sameer

            R Offline
            R Offline
            Rmesh
            wrote on last edited by
            #5

            where i have to declare that.style1

            S 1 Reply Last reply
            0
            • R Rmesh

              where i have to declare that.style1

              S Offline
              S Offline
              Sams Den
              wrote on last edited by
              #6

              You can declare it either in .aspx or create a CSS file. Thanks Sameer

              R 1 Reply Last reply
              0
              • S Sams Den

                You can declare it either in .aspx or create a CSS file. Thanks Sameer

                R Offline
                R Offline
                Rmesh
                wrote on last edited by
                #7

                ya i have done in the same way just i have right clicked the added one style sheet and i have changed the back color and some properties and changed in that cssclass property to that style sheet name it will not be changed

                S 1 Reply Last reply
                0
                • R Rmesh

                  ya i have done in the same way just i have right clicked the added one style sheet and i have changed the back color and some properties and changed in that cssclass property to that style sheet name it will not be changed

                  S Offline
                  S Offline
                  Sams Den
                  wrote on last edited by
                  #8

                  Hi, You probably might have missed the Style attribute, check the below code: /* .Style1 { FONT: 700 12pt verdana; COLOR: orange }

                  Label

                  */ P.s. this is just a fragment of code and you need to write this in .aspx page. Hope this help. Thanks Sameer

                  1 Reply Last reply
                  0
                  • R Rmesh

                    i need to know about how to use cssclass of web controls

                    T Offline
                    T Offline
                    ToddHileHoffer
                    wrote on last edited by
                    #9

                    If you are using thems. Create a default.css in your themes folder. You can set all your style information there.

                    GameFly free trial

                    1 Reply Last reply
                    0
                    • R Rmesh

                      i need to know about how to use cssclass of web controls

                      S Offline
                      S Offline
                      stephenSmithJ
                      wrote on last edited by
                      #10

                      Note vs2007 is horrible for css. - it is highly inefficient. & master pages/themes just don't cut it for high end css... Instead, design/create your page in Dreamweaver or other web design tool & do your vb/c# coding in vs2007. Then, you can link to an external css file as follows: This is much more efficient in terms of bandwidth.

                      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