473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

New at php + css. (questions/feedback on what I did wrong)

11
Hey everyone, my first post here :D

I am new to the css style of making a web page. I usually just use the html and iframe method.

my problem is...I don't really know HOW to use php and css together. I am trying it and so far so good except one thing. I dont think it's correct xD and I cant get a div to go where I want it to or check with the css for it's style.

IF YOU DONT WANT TO READ ALL OF IT GO DOWN FOR A LINK TO DOWNLOAD THE FILES. (90kb very tiny and quick download in .rar folder)



My index.php:

Expand|Select|Wrap|Line Numbers
  1. <?php include("layout.php"); ?>
  2.  
  3.  
  4. Hello
  5.  
  6. THIS IS THE BLAH and the sjdfl kjds fdsjf dkslfj dskf ldksjf sdjfk jdklfj dfkj sfkj dkslfj dlfjlskdf dsfj fdsljflka dfkjd fjlkajk dfkjd aslfjdlkf skljdf kdsjlfaj fkjldk ajkljdf kajfkla jdfkjd aslkj fkldjfkl ajfklj adlkf
  7. <?php include("content.php"); ?>
  8.  
  9. <?php include("bottom.php"); ?>
  10.  
My layout .php
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4.  
  5. <head>
  6. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  7. <link rel="stylesheet" type="text/css" href="styles.css" media="screen"/>
  8.  
  9.  
  10. <title>Nouman Layout, lol</title>
  11. <style type="text/css">
  12. <!--
  13. .style3 {    color: #92c240;
  14.     font-size: 18px;
  15. }
  16. .style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
  17. .style6 {color: #92c240; font-size: 20px; }
  18. .style7 {font-family: Arial, Helvetica, sans-serif}
  19. -->
  20. </style>
  21. </head>
  22. <body>
  23. <div id="wrapper">
  24. <div align="center">
  25. </div>
  26. <div id="header">
  27. <div class="headertext">
  28.   <div align="center">Nouman Layout, lol
  29.   </div>
  30. </div>
  31. </div>
  32.  
my content.php:
Expand|Select|Wrap|Line Numbers
  1. <div id="main">
my bottom.php
Expand|Select|Wrap|Line Numbers
  1. </div>
  2. <div align="center">
  3. </div>
  4. <div id="content">
  5. <div id="buttonrow">
  6.   <div align="center">
  7. <a href=" index.html" accesskey="i" class="button"> Home</a>
  8. <a href=" about.html" accesskey="h" class="button"> About</a>
  9. <a href=" work.html" accesskey="w" class="button"> Shopping &nbsp; >></a>
  10. <a href=" contact.html" accesskey="c" class="button"> Resturants &nbsp; >></a>
  11. <a href=" contact.html" accesskey="c" class="button"> Family  &nbsp; >></a>
  12. <a href=" contact.html" accesskey="c" class="button"> Contact  &nbsp; >></a>  
  13.    </div>
  14. </div>
  15. <div id="right">
  16.    <div align="center"> What's New </div>
  17. </div>
  18. </div>
  19. <div align="center">
  20. <div id="footer">
  21.   <div align="center">© Copyright or whatever Nouman 2006</div>
  22.   </body>
  23. </html>
  24.  
  25.  
Finely my styles.css:
Expand|Select|Wrap|Line Numbers
  1.  
  2. html {
  3. font-family: 'trebuchet ms', sans-serif; 
  4. font-size: 16px; 
  5. font-weight: bold; 
  6. letter-spacing: -1px;
  7. color: #000;
  8. }
  9.  
  10.  
  11. #wrapper {
  12.     margin: 20px auto;
  13.     width: 812px;
  14. }
  15.  
  16. #header {
  17. margin-top: 2px;
  18. background: url( Final_03.gif);
  19. height: 102px;
  20. width: 812px;
  21. }
  22.  
  23. #header .headertext {
  24. font-family: 'trebuchet ms', sans-serif; 
  25. font-size: 20px; 
  26. font-weight: bold; 
  27. letter-spacing: px;
  28. padding-top: 60px;
  29. text-align: center;
  30. color: #fff;
  31. }
  32.  
  33. #content {
  34. background: url(Final_06.gif) repeat-y;
  35. width: 812px;
  36. padding-bottom: 300px;
  37. }
  38.  
  39.  
  40.  
  41. #main {
  42. font-family: 'trebuchet ms', sans-serif; 
  43. font-size: 8px;
  44. margin-left: 200px;
  45. margin-right: 200px;
  46. width: 400px;
  47. background: #FFFFF;
  48.         }
  49.  
  50.  
  51.  
  52. #buttonrow {
  53. background: url(Greybar.gif) repeat-y;
  54. display: inline;
  55. float: left;
  56. width: 155px;
  57. height: 250px;
  58.   margin-left: 18px;
  59. overflow: hidden;
  60. }
  61.  
  62. a.button {
  63.   float: left;
  64.   width: 140px;
  65.   height: 26px;  
  66.   margin-left: 18px;
  67.   background: url( button.gif) no-repeat 0 0;
  68.   font-family: 'trebuchet ms', sans-serif; 
  69.   font-size: 14px;
  70.   margin-left: 0px; 
  71.   letter-spacing: 1px;
  72.   text-align: left;
  73.   color: #FFFFFF;
  74.   text-decoration: none;
  75. }
  76.  
  77. a:hover.button  {
  78.   background-position: 0 -26px;
  79. }
  80.  
  81. #right {
  82. background: url(Greybar1.gif) repeat-y;
  83. display: inline;
  84. float: right;
  85. width: 155px;
  86. height: 250px;
  87. overflow: hidden;
  88. }
  89.  
  90. #footer {
  91. overflow: hidden;
  92. background: url(Final_08.gif);
  93. height: 41px;
  94. width: 812px;
  95. font-family: 'trebuchet ms', sans-serif; 
  96. font-size: 22px; 
  97. font-weight: bold; 
  98. letter-spacing: -1px;
  99. color: #fff;
  100. text-align: center;
  101. line-height: 42px;
  102. }
  103.  
LINK:
http://www.sendspace.com/delete/s2cc6n/wfvoq
Jun 1 '07 #1
7 1972
Motoma
3,237 Expert 2GB
What you first need to realize is that a PHP file is a program that generates HTML (or whatever else you want it to). To debug the CSS, navigate to the site, and do a simple view source. Find out what your errors are in the HTML, and try to navigate to the PHP that is causing it.
Jun 1 '07 #2
Nouman6
11
I don't have an error, actually what I need is for this:

http://img106.imageshack.us/img106/8719/problemit3.png

notice the text div? I want that to be in the center of the left(navy) and right div and be aligned on the top as well.
Jun 1 '07 #3
Motoma
3,237 Expert 2GB
I don't have an error, actually what I need is for this:
notice the text div? I want that to be in the center of the left(navy) and right div and be aligned on the top as well.
I understand now. I have moved your thread to the HTML/CSS forum.
Jun 1 '07 #4
drhowarddrfine
7,435 Expert 4TB
The link is to where to delete the file and not the download itself. cut/pasting this doesn't work but I'm still looking at it.
Jun 1 '07 #5
drhowarddrfine
7,435 Expert 4TB
1) I would not style <html> but apply all that to the body instead.
2) You declare html transitional but are using Xhtml end tags: />. Lose the slash. Sometimes a browser stops all processing at that point.
3) New pages should be created using the strict doctype and without deprecated elements.
4) You have a case of 'divitis' where everything is in a <div>. Divs are used to help create structure by grouping related elements. Positioning is a bonus but all elements can be positioned on their own and don't need a div.

There's too much missing in the posted code to pinpoint what is going on. Can you get this online with everything? I mean the generated html/css. The PHP is not useful.
Jun 1 '07 #6
Nouman6
11
here, sorry for wasting your time with the delete link xD I had copied the wrong link.

http://www.sendspace.com/file/g7r4k7

that should be it. :D
Jun 1 '07 #7
Nouman6
11
(can't edit :( )

anyways nvm I have got it to work out fine.

now if anyone can look into my new files and fix what I did stupidly or what is unneeded and stuff like that and send it back so I can review it, that would be LOVELY! I really want to get this stuff nailed down the right way from the start so I don't continue on the wrong path.



http://www.sendspace.com/file/xl1hoq
Jun 1 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
6
by: aeldaly | last post by:
Hello all, I have just finished what I call Site Management System v0.0.0.0.0.0.0.0.0.1 :D I am not a professional programmer nor a really experienced one either (I've been dabbling with stuff...
41
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What...
18
by: free2cric | last post by:
Hi, I attanded an interview on C++ Question asked were and my answers to them.. 1. In a CPP program what does memory leak occure? -- i said.. In a constructor , the pointer variables were...
30
by: GeorgeRXZ | last post by:
Hi Friends, I have some questions related to C Language. 1What is the difference between the standard C language and Non standard C language ? 2which is better C Lanugage, C under Linux/...
3
by: robtyketto | last post by:
Im a student and in preparation for a testIve been given the test questions (or thereabouts, they may be asked in different words or from another perspective). I've been told that they do not...
16
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, I am using Visual C# window to dispaly a set of questions with their answers. The users should be able to move to the next question by clicking on next button. I am going to use only one panel...
5
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I've got a .Net client to a soap service that works for the most part, but there are a couple of things I'd like to improve: 1) the first request to the client wrapper always takes...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.