Skip to:
Content
Pages
Categories
Search
Top
Bottom

style vs screen CSS


  • concrain
    Participant

    @russelrocketpopmediacom

    what is the purpose of the style.css when the screen.css overrides the style.css?

Viewing 17 replies - 1 through 17 (of 17 total)
  • A quick look at the files reveals that screen.css is imported by style.css. There is no overriding going on.


    concrain
    Participant

    @russelrocketpopmediacom

    what calls the screen.css? I cant seem to find this in any php docs..

    style.css has this line in it

    @import url( _inc/css/screen.css );


    concrain
    Participant

    @russelrocketpopmediacom

    opps i meant to ask what pullls the style.css

    thanks


    Xevo
    Participant

    @xevo

    A <link> inside the header, like it usually is..


    concrain
    Participant

    @russelrocketpopmediacom

    Sorry im still a rookie. The first place I look was the header.php all I found was this

    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />

    correct me if i am wrong but is this using the (‘stylesheet_url’) as a variable?

    I dont understand how this line of code is working


    Xevo
    Participant

    @xevo

    Yes, that line gets your current theme’s style.css file. In buddypress’s case, it’ll get the bp-sn-parent style.ccs..

    That line of code pulls in style.css… which in turn imports screen.css, fonts.css, admin-bar.css… etc. There actually aren’t any styles in style.css.


    concrain
    Participant

    @russelrocketpopmediacom

    I guess what i dont understand is how does it specify the style.css ??

    what if i want to pull a different one, how would i do that??


    Xevo
    Participant

    @xevo

    Every wordpress theme needs at least a style.css file, bloginfo(‘stylesheet_url’); tells the theme to get it’s style.css file. If you want another one, change the style.css or just add another stylesheet underneath your style.css sheet.

    If your totally new to WordPress, try downloading a theme from the wordpress theme directory on wordpress.org and see how it’s made. Maybe then you’ll have a better understanding on how to do things in wordpress, like calling multiple stylesheets.

    Here’s an example.

    <link href="<?php bloginfo('template_directory'); ?>/css/style2.css" rel="stylesheet" type="text/css" />


    concrain
    Participant

    @russelrocketpopmediacom

    Sorry to keep bugging you guys.. All im trying to do is create a css file for IE7

    Just cant seem to get this too work.

    <!–[if IE 7]>

    This is an IE 7 browser // this will show in the browser so i know the “if” statement is working.

    <link href=”<?php bloginfo(‘template_directory’); ?>

    /bp-default/_inc/css/screen-ie.css” rel=”stylesheet” type=”text/css” />

    </style>

    <![endif]–>


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    http://codex.wordpress.org is probably the best place to start when trying to figure out what functions perform what tasks for what purposes. Also, think about using an IDE like NetBeans so you can reference functions and trace their usage to get an idea of why you would or wouldn’t want to use a specific function, action, or filter.

    WordPress has a steep learning curve, and it uses an action oriented code structure rather than an object oriented one. There are objects out there, but you rarely interact with them directly, and in the WordPress world interacting with those objects is typically left to plugin developers to tinker with, and best left out of the template files.

    Since you’re just learning, the best advice I can give you is not to edit any “core” file, or rather any file that comes included in WordPress or any plugin that you might use. If something isn’t doing exactly what you want it to, chances are you can adjust it somehow. If you can’t adjust it, make your own plugin and copy/paste the code that isn’t good enough and make your own functions out of them. If someone would have told me that 3 years ago I would have been a much happier person then. :)

    Your code is wrong. Try this in the head section of your header.php file

    <!--[if IE 7]>
    <link href="<?php bloginfo('template_directory'); ?>/_inc/css/screen-ie.css"
    rel="stylesheet" type="text/css" />
    <![endif]-->

    And unless you want to view source to see if it’s working (i.e. your comment line)… I’d just do some ridiculous in the css file like:

    body {font-size: 400% !important;}

    You’ll know right away if it’s working. But that will work. Your link was just wrong and you had a stray style close tag which you didn’t need.


    Boris
    Participant

    @travel-junkie

    Actually you’d need to use

    bloginfo('stylesheet_directory')

    template_directory gets your parent theme directory, while stylesheet_directory gets your child theme directory

    Ah right. I’d copy/pasted that from a standard WordPress theme. Thanks for the correction.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Ultimately it depends on what you’re trying to accomplish. Either/or could work in different circumstances.


    concrain
    Participant

    @russelrocketpopmediacom

    thanks guys it works :D

Viewing 17 replies - 1 through 17 (of 17 total)
  • The topic ‘style vs screen CSS’ is closed to new replies.
Skip to toolbar