Jason G. Designs

WordPress Themes, Print-On-Demand Resources and more…

How To Slice Up Graphics for XHTML and CSS


Creating an XHTML Page

6. For now, you can close Gimp, as we will be putting together an XHTML page and CSS stylesheet. We will also place dummy content to test some basic tags. We will not work with the unordered lists until we convert our static XHTML page into a WordPress theme, as this information is generated by WordPress

7. Open a text editor. Windows Notepad or Macintosh’s TextEdit will work just fine, but I prefer to use a real text editor with options. I recommend HTML Kit

  • In HTML-Kit, I opened a New Blank HTML Page. The html generated is posted below. You can Copy and Paste this into a New file. Right now it is not an XHTML page, but we will handle that in WordPress later
  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <title>Page title</title>
  • Save As “index.html” in the folder where the Gimp layout file is stored
  • Now we are going to add the same dummy text we had in our layout
  • Just under the <body> tag, type: <h1>My Blog</h1>
  • By this point, we can open our file in a browser. I’m on Windows, so I’m choosing Firefox 3 and Internet Explorer 7, which I have installed. If your on another OS, it’s a good idea to open two browsers to see the inconsistencies. Internet Explorer on Windows usually needs special treatment, however, we will add the CSS hacks, if any, in this tutorial
  • Next, just below the h1 tags, type or Copy and Paste the following:
  • <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
    Fusce metus magna, lobortis non vehicula vel, fringilla consectetur enim. 
    Nulla pellentesque ligula consequat risus adipiscing condimentum. Cum 
    sociis natoque penatibus et magnis dis parturient montes, nascetur 
    ridiculus mus. Vivamus iaculis pretium nisl sit amet cursus. 
    Sed est massa, dictum in euismod id, consequat ut diam. Phasellus 
    accumsan, tortor in accumsan convallis, purus libero blandit mi, vel 
    gravida eros mi eget lacus. Aenean ac mi tortor. Nulla facilisi. 
    Suspendisse laoreet orci non velit varius elementum. Curabitur eu 
    blandit mauris.</p>
  • Below the paragraph, simply type <h2>Pages</h2>
  • Finally, below there, type the footer information: <p>&copy; My Blog</p>

Dividing Each Section

8. Now we are at the point when we divide our layout into Header, Footer, Content and Sidebar with a Wrapper placed around the whole layout. In this part of the tutorial, we will also set the background colors and basic tag colors

  • Wrap div tags with id titles around the different sections as shown in the code below:
  • <!-- opens wrapper div -->
    <div id="wrapper">
    <!-- opens header div -->
    <div id="header">
    <h1>My Blog</h1>
    <p>Just Another WordPress Blog</p>
    <!-- closes header div -->
    <!-- opens content div -->
    <div id="content">
    <h2>Post 1</h2>
    <p>Lorem ipsum...
    <!-- closes content div -->
    <!-- opens sidebar div -->
    <div id="sidebar">
    <!-- closes sidebar div -->
    <!-- opens footer div -->
    <div id="footer">
    <p>&copy; 2010 My Blog</p>
    <!-- closes footer div -->
    <!-- closes wrapper div -->
  • The items that begin with <!– and end with –> are HTML comments; use these liberally within your code, so others who view your code can understand it. Here, the page code is fairly short, but imagine source code with divs embedded in 1000 lines of code

9. In addition to this, we will add two divs within the header div. The first will house our blog title (or logo), and the second will house our second widget ready sidebar

  • Create the two divs below with ids “left” and “sidebar-2”:
  • <!-- opens header div -->
    <div id="header">
    <div id="left">
    <h1>My Blog</h1>
    <p>Just Another WordPress Blog</p>
    <div id="sidebar-2">
    <!-- closes header div -->

Tags for this post: , , , , ,

Page: 1 2 3 4

1 Comment

  1. Saleem says:

    hi I have to create a pilocy document which needs to exist in 2 different countries. So I want to have one common document (the bulk of the document) and insert various sections that can vary by country.Can you point me to a simple way to do this please?

Trackbacks and Pingbacks

Trackback URL for this post: http://www.jasong-designs.com/2013/05/31/how-to-slice-up-graphics-for-xhtml-and-css/trackback/

  1. […] Creating a Fancy Website Layout in Gimp 2.6, and How To Slice Up Graphics for XHTML and CSS. […]

  2. […] How To Slice Up Graphics for XHTML and CSS […]

Leave a Reply

Your email address will not be published. Required fields are marked *