css PRO question

Discussion in 'HTML & Website Design' started by rush4rk, Jul 21, 2007.

  1. #1
    hello there,

    How do you add alt="" and clickable link to that

    .header2 { background: #FFF url(images/myphoto.jpg) no-repeat center; width: 100%; height: 28px; color: #FF8D00; }

    thank you,
     
    rush4rk, Jul 21, 2007 IP
  2. jawanda

    jawanda Peon

    Messages:
    151
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe you will have to just do it inline in your html document, not as part of the style declaration.

    <-2 cents

    -P
     
    jawanda, Jul 21, 2007 IP
  3. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nope. You have to use the title="" attribute on the link. Also, in order for the link to take up all the available space, you have to set its display to block.

    Here's an example:

    <h1><a href="#" title="Tooltip text. Blah blah blah blah.">Heading with a Link</a></h1>

    And then styled...

    
    h1 {
        background: #FFF url(images/myphoto.jpg) no-repeat center;
        color: #FF8D00;
        height: 28px;
    }
        h1 a {
            display: block;
            width: 100%;
        }
    
    Code (markup):
     
    Dan Schulz, Jul 21, 2007 IP
  4. rush4rk

    rush4rk Active Member

    Messages:
    367
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    well I use wordpress and I have two pictures in the head.
    wordpress theme uses PHP and there is a link like <php something header>
    which gets the header from CSS,
    So, since i'm not even a newbie in PHP, I can't do much.
    All I see is PHP gets it from css and as I understand I have to add something in css, but
    is it possible at all Adding alt=``image name`` and make the image clickable.
    it is my signature site btw..
     
    rush4rk, Jul 21, 2007 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What does the PHP code look like?
     
    Dan Schulz, Jul 21, 2007 IP
  6. rush4rk

    rush4rk Active Member

    Messages:
    367
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Like this the header.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php wp_head(); ?>
    </head>


    and index.php

    <?php get_header(); ?>
    <?php get_sidebar(); ?>


    <div class="lside">

    <div class="padding">

    </div>


    and css like that

    body { margin:5px 0; padding:0; font: 80% Verdana, Arial, Helvetica, sans-serif; color:#000000; line-height: 1.4em; background : #BEC5D3;}
    .content { color: #505050; margin: 0 auto; padding: 0; width: 90%; background: #FAFAFA;}
    .header1 { background: #FFF; width: 100%; height: 17px; color: #FF8D00; }
    .header { background: #FFF url(images/header.jpg) no-repeat center; width: 100%; height: 106px; color: #FF8D00; border-bottom: 1px solid #cccccc; border-top: 1px solid #cccccc; }
    .topmenu { background: #546078; padding: 0px 0px 0px 2px;}
    .header2 { background: #FFF url(images/sushicup.jpg) no-repeat center; width: 100%; height: 28px; color: #FF8D00; }
    .header .padding { padding: 30px 0 0 35px; color: #FFF; }
     
    rush4rk, Jul 21, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorry, I should have specified "what does the PHP code for your header.php file look like?" instead of what I said. Can you show that to me?
     
    Dan Schulz, Jul 21, 2007 IP
  8. rush4rk

    rush4rk Active Member

    Messages:
    367
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <?php wp_head(); ?>
    </head>



    <body>
    <div class="content">

    <b><div class="topmenu" align="center">
    <a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a>
    </div></b>

    <div class="header1">
    <div class="style3"><?php bloginfo('description'); ?>
    </div>
    </div>
    <div class="header2">
    </div>
    <div class="header1"> <div class="style4"><?php bloginfo('description'); ?></div>
    </div>
    <div class="header">
    </div>

    <div class="rside">
    <div class="loginbox">
    <div class="padding">

    </div>
    </div>


    like this
     
    rush4rk, Jul 21, 2007 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Inside header2.php look for this:

    <div class="header2">
    </div>

    Inside that, put a link inside that ( <a href="/link/to/page/">Link to page</a> ) and style it appropriately.

    Also, judging from the quality of the HTML and CSS code, I think you're using both way too much HTML and CSS for the job you're trying to do as well as the wrong kinds of code.

    If you don't mind me asking, is this a pre-made theme you're trying to modify?
     
    Dan Schulz, Jul 21, 2007 IP
  10. rush4rk

    rush4rk Active Member

    Messages:
    367
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #10
    yes it is.
    hmm I was also wondering why the <body> is there and inside that a header? it is kinda not good for SEO right?
     
    rush4rk, Jul 22, 2007 IP
  11. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #11
    The header.php file is just the header file for the template. It's what holds all the main code. The browser (or the search engines) won't care what .php file the <body> tag is in, since all they'll see is the HTML output anyway.

    One other thing - where did you get the theme from?
     
    Dan Schulz, Jul 22, 2007 IP
  12. rush4rk

    rush4rk Active Member

    Messages:
    367
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #12
    well, it is lightbiz theme, I kinda liked it and I have changed some stuff in there. like removed the search box and made the header image instead. but right now my problem with the theme is that it changes the look when you view it with IE old ver. It drops down the news section to the botttom when the browser is small. I want t deal with that. Also it makes the robot to read the menu section 1st, which is not good. I want to make it so that the robot reads the news section 1st and then reads the menu. I'm really confused about this. I have tried to transfer the menu to the left side since it will give a nicer look, but I don't know excatly how to do that. That's pretty much it.
    If you could help me out, I will be glad to promote anything you got ^.^
    btw, how do you like my site, any comments are welsome.

    thank you,
    rush4rk
     
    rush4rk, Jul 25, 2007 IP
  13. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #13
    It doesn't matter one iota if the search engine spiders the menu or the content first, as long as the menu doesn't have more keywords in it than Carter has Little Liver Pills and is short and to the point. As for Internet Explorer, it sounds like a box model problem. I'd have to look at the HTML code for certain to find out though.

    In the meantime, have you run your HTML and CSS code through the validators?

    http://validator.w3.org and http://jigsaw.w3.org/css-validator/
     
    Dan Schulz, Jul 25, 2007 IP