Advanced Search

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Complete Newbie here - site content in css

  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Complete Newbie here - site content in css

    Ok, so I'm sure this is a very simple question for you guys, but I'm trying to make a very basic website in which the header (image and or text), links, and contact information remain constant throughout the site via css. In other words, if I add or edit a link, or want to change the image in the header, I want to do it only via css so it makes the changes on every page of the site... Apologies in advance if this question has been answered a hundred times, but there's so much information out there I can't sort it out!

    thanks for any help!
    Dan

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    CSS is for styling only. You can maintain the same styling on links, images, and text with CSS, but you can't control the actual text of the links and/or contact information.

    For example, if you wanted all of your links to be red and bolded, you could write CSS like this:

    Code:
    a { color:red; font-weight:bold }
    Now, if you wanted to change the color, just change the red to blue or whatever. Same thing applies to regular text.

    The header is a little different. You could control the image via CSS by applying it as your background do the header div.

    Something like this:

    CSS
    Code:
    #header
    {
       background-image:url(background.jpg);
       height:200px;
       width:100%;
    }
    HTML:
    Code:
    <div id="header">
       <h1>My Website's Title</h1>
    </div>

  3. #3
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response Medyman. So, for the most part, I'm barking up the wrong tree with CSS? How do the designers or administrators of large, extensive websites make changes and updates so that each individual page doesn't have to be edited? Thanks again for your help!

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    you create the pages to share similar tags, and you use your CSS stylesheet to "markup" or change the similar elements (tags) to look more cosmetically appealing

    if you are talking about content, well then thats usually done through some sort of template or database driven code

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by blackvista View Post
    Thanks for the response Medyman. So, for the most part, I'm barking up the wrong tree with CSS? How do the designers or administrators of large, extensive websites make changes and updates so that each individual page doesn't have to be edited? Thanks again for your help!
    That's done with some sort of server side language, such as PHP. tech_support has a great tutorial in the tutorials section (link) on creating a basic PHP template which might be of use to you.

  6. #6
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wow, it's amazing how little I know about all this stuff! I have no php or databasing knowledge...

    Okay, I realize this thread has moved away from the topic of css, but I have one more question and I'll stop bugging you guys. It seems to me that I've heard about an option in Dreamweaver which will automatically go through all your html files and make the same changes to all of them; was I dreaming?

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by blackvista View Post
    Wow, it's amazing how little I know about all this stuff! I have no php or databasing knowledge...

    Okay, I realize this thread has moved away from the topic of css, but I have one more question and I'll stop bugging you guys. It seems to me that I've heard about an option in Dreamweaver which will automatically go through all your html files and make the same changes to all of them; was I dreaming?
    No, it's possible. Not just with Dreamweaver either, a lot of your well developed text editors have a find & replace feature for multiple files. But it is a find & replace feature.

    It won't change an entire code block. The other problem with it is that it's not an intelligent process. You have to be very meticulous in what you enter as the find/replace string. You also have to be very meticulous in coding and make sure that all of the code you use is identical.

    Too much room for error for my liking.

    Now, I don't use Dreamweaver so there might be a more advanced feature that I'm unaware of. If you're serious about learning HTML/CSS, I'd recommend that you stay away from Dreamweaver. Then, when you do know it, you won't want to go near it anyway.

    More info: http://www.haverford.edu/acc/docs/so...welcome.htm#3A

  8. #8
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Getting back to your original query...

    For small pieces of information, I use the following.
    <!--webbot bot="Include" U-Include="filename.htm" TAG="BODY" -->
    Don't know what it is...
    Don't know where it came from...
    I've been using it for near on 10 years, now.

    I do the "style" in the intended page's CSS...not the orignal ( external ) file.
    In fact, the orignal htm is minimal.
    I have even used it to call txt files to an intended page without a problem.

    I don't use the above for large pieces/chunks of content.
    But, it's great for say "copyright" information, or contact information. . . snippets of boring input that you want to appear the same throughout the site.

    And, I do use this for menu lists as external files.
    Never experienced a problem with it.
    Only have to update ONE ( thank goodness ) menu for an entire site.

    There are qwirky behaviors if you attempt multiple instances with this code on the same intended page. The files seem to crash...and sometimes display the first called over and over. So, I do not recommend it for large files, or multiple instances on the same intended page.

    I create the information in a separate - bare bones - htm file.
    Insert the code above into my html, with the appropriate filename of course.
    Then, when the external file [ filename.htm ] needs an update, I make it to the orignal htm file, and it is changed across the entire site.

    =======================================================

    For larger instances...and multiple intances...
    There are javascripts ( on dynamic drive ) what will call large files, and seem to work wonders with multiple instance on the same intended page. A simple search on DD for "iframes" or "display external pages" is probably going to get you a bunch you can review for your purpose.


    Hope this helps.
    terrik

  9. The Following User Says Thank You to terrik For This Useful Post:

    OverMachoGrande (04-12-2008)

  10. #9
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    @terrik,

    Quote Originally Posted by terrik View Post
    <!--webbot bot="Include" U-Include="filename.htm" TAG="BODY" -->
    Don't know what it is...
    Don't know where it came from...
    ...Well, you'll know it now

    ...This is HTML Comment Tag

    Contents inside the comment tag will be ignored by the browser.

    Hope that helps you
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  11. #10
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    @ rangana

    Yes.
    I do realize that the
    Code:
    <!--
    and the
    Code:
     -->
    Are html comment tags; opening and closing, respectively.
    And I know the characters enclosed between the two will not be displayed - as written - in the html file, and in most cases are completely ignored by the browser.

    . . . thank you.

    I was actually referring to the bit between the two tags when I said
    "Don't know what or where".

    Still...the little piece of coding works wonders!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •