Loading...
  1. Dismiss Notice
  2. Dismiss Notice
  3. Dismiss Notice
  4. Dismiss Notice
  5. If this is your first visit, you may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Relearning CSS

Discussion in 'Programming Lounge' started by Kyle, Aug 8, 2014.

Thread Status:
Not open for further replies.
  1. Kyle

    Kyle Banned Forum Legend

    Joined:
    Sep 13, 2010
    Messages:
    4,121
    Likes Received:
    1,196
    Trophy Points:
    353
    Hi,

    I am starting to relearn the basics of CSS and HTML. I might have a few questions so if anyone knows the answers. Be great to get some help. I learned alittle bit of CSS and HTML back in high school. But since I never used it, I pretty much lost a lot of info.

    Let me start off with this.

    Basic knowledge. When writing something like:

    div.container {

    when you see the "." that basically starts a new class right? And then you name that class that (with my understanding of python) makes a variable. So basically anything after the dot is just a name right? Nothing really important?

    I am having hard time explaining this. Basically. I am asking if container is an actual code or a variable.
     
    Last edited: Aug 8, 2014
  2. Puddles

    Puddles Tͮh͌̀ͩe̅̋̔̓ͣ̎͟ ̔ͫ̈́̾ͩG͗́̓o͐̍d̊̊̄d͑̔̎͑ ̋̾͏e ̏̏ͬ͌s̶s͛ Forum Legend

    Joined:
    Dec 29, 2010
    Messages:
    5,719
    Likes Received:
    5,529
    Trophy Points:
    568
    Location:
    Behind You
    Here is a small very small snippet of a CSS I was working on a while ago. It was made for use with HTML5 though basically CSS is very similar outside of different tags available with in the language

    body {
    font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
    background-color: #FFFFFF;
    margin: 0;
    padding: 0;
    color: #000;
    }

    Now, as you are asking about both CSS and HTML (I assume 5 as that happens to be what most people use now), we start with the CSS. The div containers are more for forming your layout. Anyway.

    In this little bit here, everything in the { } is what the html tag body will be formatted as, so it will have any font used on the body (of course if you change it with something else then it is different) along with those other little statements with out having to clutter your sites pages with coding that can be done. Basically CSS just sets all of your HTML tag parameters


    You also set your classes inside the CSS such as this one

    .floatright {
    float: right;
    margin-left: 8px;
    }

    It basically does what it says, and such what not it makes things float on the right =p

    Your use of DIV here is incorrect as it just makes sections, which are then allocated with top, left tags, also height and width. Now, the thing about DIV is that (im not sure if it is still supported but I assume it is) the z-index and it is something good to know how to use as well.

    what the z-index does for you is allows you to order, the layers. I forgot what the code thing was so uh sue me? Anyway, thats the basics and what I remember off the top of my head. I think you still have my skype somewhere so if you have questions feel free to send me a message or something I'll help where I can dear.
     
    1 person likes this.
  3. Slyther

    Slyther Oculus Ex Inferni Forum Legend

    Joined:
    Oct 27, 2011
    Messages:
    2,540
    Likes Received:
    1,883
    Trophy Points:
    398
    My knowledge of Web Languages are close to null, but if CSS and the such are anything even similar to object-oriented programming languages, this might help:

    Suppose you have a class "Dog", and inside the class dog you have a boolean "hates_cats", where it can be either true or false.

    To access the boolean inside your instance of dog, it'd look something like this:

    Code:
    Dog Fappy; //declaration of an instance of class Dog
    Fappy.hates_cats = false; //fappy, according to what you're saying, doesn't hate cats
    
    if(Fappy.hates_cats) //checks if fappy hates cats
    {
        //do something
    }
    You're basically accessing an attribute or function within a namespace, although it could also be used to declare things.

    Suppose you have a namespace GamezAion, in which you have the classes Aion_Master, Moderator, and VIP. In some languages, that might look like this:

    Code:
    namespace GamezAion{
         class Aion_Master{
                //attributes n shit
         }
         class Moderator{
                //attributes n shit
         }
         class VIP{
                //attributes n shit
         }
    }
    You can then declare instances of these like this (again in certain languages):

    Code:
    GamezAion.Aion_Master Guille = new GamezAion.Aion_Master();
    GamezAion.Moderator Gabi = new GamezAion.Moderator();
    GamezAion.VIP Grrr = new GamezAion.VIP();
    And then you can use these instances of such classes as you normally would.

    I'm pretty sure I might have confused you even more at some point in time and that's because, as I said, my knowledge of Web Languages nears nullity (which it really shouldn't, considering I'm taking a class that's basically about web development right now), so forgive me beforehand.

    Also, I haven't checked these pages out yet but I assume there must be something regarding web languages somewhere in them, so that might help you a lot more than anyone on forums could:

    https://www.codeschool.com/

    Learn to code | Codecademy

    EDIT: Note Puddles's post which basically shows how little I know about web development that I didn't even give you a properly set example that might actually help you.
     
    Last edited: Aug 8, 2014
  4. Kyle

    Kyle Banned Forum Legend

    Joined:
    Sep 13, 2010
    Messages:
    4,121
    Likes Received:
    1,196
    Trophy Points:
    353
    Yea. Puddles got on skype and explained it more to me. I get what your saying. I got a better understanding now. Right now. im just doing alot of wash, lather, rinse and repeating with these codes. To hopefully to fully understand them by just rewriting them alot.

    I might post a couple more questions if I get lost in something.
     
  5. Razor

    Razor Master of Disguise Forum Legend

    Joined:
    Oct 14, 2010
    Messages:
    3,356
    Likes Received:
    2,072
    Trophy Points:
    463
    Location:
    Sofia, Bulgaria
    You might wanna try jQuery as well if you need practice with managing classes and don't want to get lost with what you're doing. Plus it's fun because your thing is doing something as in action as opposed to manipulating appearance ;)

    Not to mention those two go hand in hand and its basically the next stage to completing a functional web page.
     
Thread Status:
Not open for further replies.

Share This Page