473,796 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

11 New Member
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.c om/delete/s2cc6n/wfvoq
Jun 1 '07 #1
7 1987
Motoma
3,237 Recognized Expert Specialist
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 New Member
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 Recognized Expert Specialist
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 Recognized Expert Expert
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 Recognized Expert Expert
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 New Member
here, sorry for wasting your time with the delete link xD I had copied the wrong link.

http://www.sendspace.c om/file/g7r4k7

that should be it. :D
Jun 1 '07 #7
Nouman6
11 New Member
(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.c om/file/xl1hoq
Jun 1 '07 #8

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

Similar topics

54
17441
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 give interviewees seems to trip them up all the time, and I wonder if I'm being too much of a hardass... it seems easy enough to ME, but these guys, when I get them up to the whiteboard, seem to get really confused. The exercise is this:
25
3493
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 within a try statement myself, or is there some clever implementation enhancement which makes this a bad idea? i.e. should I prefer: if hasattr(self,"datum"): datum=getattr("datum") else: datum=None
6
1549
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 for the last 10 years), so I would like you, the experts, to have a look at the code and provide me with your feedback. I do not know if I implemented good security practices or not and if I have made the functions efficient enough.
41
2660
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 was really special about that site is that the validation service was available in Russian, German, Spanish and English. Now, I can't find this site anymore. I did search google. Do you know such site? What's its url? 2- Generally speaking, the...
18
2501
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 assigned a memory block but the programmer forgets to free them in the destructor by usng delete operator. 2. ok, the delete operator is used .. variables were freed. but still
30
2299
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/ Unix or C under windows/ DOS ?
3
4428
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 require long answer, short punchy bullet points are fine, and I guess to justify your points too. So since I got up this morning in the UK for the last 3hrs Ive done some resarch and come up with a set of notes/answers. Remembering this is an...
16
2110
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 to display one question and move to next question. Can someone please help me with the codes on coding "Next" button? Thanks -- Nejadian
5
3076
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 12-15 seconds even though the web server shows < a half second spent on the request. What takes so much time for the client wrapper to warm up? All subsequent requests, even to the same method, take the half second.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10465
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.