Here are a few. I've used most of them at one point or another, and they work well enough.
Regards, Arkinder
I don't know enough about PHP's variable scope to tell you for sure, but I don't think so.
Regards, Arkinder
Almost, your sidebar.php file would need to look like this.
<div id="sidebar">
<p/>
<a href="http://www.ewh.ieee.org/r1/schenectady/">
<?php
$ROOT = "http://ewh.ieee.org/r1/schenectady/";
echo "<img src=\"" . $ROOT . "images/image.jpg\">";
?>
</a>
<p/>
Regards, Arkinder
Ah, in your sidebar.php, yes.
$ROOT = "http://ewh.ieee.org/r1/schenectady/";
echo "<img src=\"" . $ROOT . "images/image.jpg\">";
Regards, Arkinder
I have no idea what you're talking about. There is no HTML element that can import anything. Are you wanting a background image, color, etc? You simply aren't providing enough information.
Regards, Arkinder
How classy of you.
This isn't production code, and there are compression programs available to remove whitespace. Readability is important for debugging, scanning, and reading in general. This is a forum, and considering that we read 30% slower on a computer, I'd rather not waste my time reading tag/selector soup for a disregarded end tag or forgotten semicolon. Whitespace does not belong in the final produced code, but it has its place in web design.
You've only been on this forum for a year, but just in case you forgot, here's a little reminder.
Regards, Arkinder
My apologies, I've been having a very forgetful day today. Add your html selector again.
html, body {margin:0; padding:0; height:100%;}
div#main_container {min-height:100%; height: 100%; background:red;}
div#sub_container {height:100%; background:green; overflow:auto;}
Regards, Arkinder
Haha, I let myself be distracted by the second overflow problem and ignored the original one. Add overflow: auto;
to div#sub_container
Regards, Arkinder
You and I are clearly getting different resultes ^_^ (refer to the attached screenshot).
Have you tried copy and pasting my finished example? Is it having the same problem? If you're using different, or have added code, please post it. What browser are you testing in?
Regards, Arkinder
The entire purpose of using the percentage unit is for a dynamic value. The problem with percentage is the browser is normally left with the question "percentage of what?"
All the browser knows is that you want div#sub_container
's height to be 100%. It interprets it as 100% of div#main_container
's (it's parent element) height. div#main_container
doesn't have a set height, so it's height is equal to the height of it's content. All you've told the browser is the min-height cannot be below 100% - in this case 100% is the height of the content. The height
and min-height
properties are not the same. height
tells the browser the desired height of the element. min-height
tells the browser the minimum height an element can be.
To fix this give div#main_container
a min-height: 100%;
and a height: 100%;
You should now have this,
html, body {margin:0; padding:0; height:100%;}
div#main_container {min-height:100%; height: 100%; background:red; }
div#sub_container {height:100%; background:green;}
You are still left with an overflow problem, so let's keep going through the "height tree." div#sub_container
's height is 100% of div#main_container
's height. div#main_container
's height is now 100% of the body
element's height, and the body
element's height is 100% of the html
element's height. So the html
element's height is 100% of the browser's default height.
Basically what this is saying is that the height of div#subcontainer
is only going to be the default height of the browser window (height = window without vertical scroll bar). …
Could you not give the column a set height? This will give any new links exceeding the height start in a new column.
Regards, Arkinder
Percentage just depends. If you want the height to be dynamic use em.
It's moving around because you have no content to push it down. Give your container
division a set height (px, em, etc.)
Or you can give your footer
division a margin-top.
Regards, Arkinder
Hm, I added
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
To the top of the page and it looks nice in Chrome and IE, but in Firefox the sidebar is all "scrunched up" (for lack of a better term.. haha). Basically the line breaks between the links are missing, so it looks like a paragraph instead of 10 separate links.
Any idea what would cause that?
I'm going to quote a mentor of mine for this,
“That line your are playing with is the doctype which is required for all modern web pages. If it works without it, that tells me you originally created the page without it. The doctype is the set of rules you are telling the browser you are using to create the page. Change the doctype, change the rules.” - doc
The doctype should never be an after thought.
Regards, Arkinder
For your numbered list to display correctly in Chrome, increase the height of your quickSummary
bar. This will keep the list pushed to the right. <a href="#"><h1>proofseeker</h1></a>
is not aloud, but <h1><a href="#">proofseeker</a></h1>
is.
Your footer displays consistently in Firefox, Safari, Chrome, and Opera. Could you describe the problem, what browser it's occurring in, and/or provide a screen shot of the problem?
Regards, Arkinder
All of this sounds great; but without any knowledge or experience with HTML or CSS you're simply wasting your time; and we can't do it for you.
What did you use to make the design? Is it just an image of what you would like your web page to look like?
Regards, Arkinder
Note: Never ever use tables for layout. This was a method used for presentation before other options existed, in 1996. David Siegel, the guy who had the fantastic idea, regretted it a year later. We now have Cascading Style Sheets (CSS), use it instead.
I was unaware of this plugin. Not that I'll ever use it, but it's nice to be updated.
jQuery is a JavaScript library that has a plugin for almost any animated effect you can think of. It's been taking over the web lately, and it's easy to see why. There are some exciting things in stored with the release of CSS3, and jQuery's use growing. For those that are interested, some interesting examples can be found here, here, and here - this is also cool.
Regards, Arkinder
Note: Even though the conversation is some what related; we should probably stop hijacking this thread. ^_^
Not supported for a very good reason...
One of the most unattractive effects of the 90's
Another useless attempt, like tables for layout, to bring style and presentation where it shouldn't be; and we are still paying for it today.
Regards, Arkinder
The blink tag is deprecated and shouldn't be used. Use the jQuery Blink plugin instead. Simply include the jQuery library and plugin in your code, then any element with the class blink
will blink.
Regards, Arkinder
The value blink
was used in CSS1 to replace the Netscape browser's blink
tag, which is deprecated. The value is not supported in IE, Chrome, Opera, or Safari.
Regards, Arkinder
It's not an error, IE simply lacked the support for the format. For loading times sake, use the gif format. If the png format is absolutely necessary, use the JavaScript code posted by Kraai. Both are excellent solutions.
Regards, Arkinder
I understand, and it's a very good thing to encourage. However, if you read all of the original poster's messagers, you will see that he or she had requested something similar to Twitter's search bar. After posting just the input from Twitter's code the poster ran into the problem of, "You can't click on the magnifying glass, it's not a button, just a picture." So the rest of Twitter's code was posted - just pointing out that the user did in fact ask.
Myspace was originally coded in 2003, long before standards had really taken hold - they still haven't really. There's no debating that their code is sloppy at best; but if you became the biggest social networking site for a few years after being created in 10 days - would you like trying to rewrite the code? It's a nightmare and they know it.
Regards, Arkinder
The a
tag is an inline element, and displays inline by default. ^_^
Regards, Arkinder
You're using both float: left;
and position: absolute;
, only one is needed and putting only cancels one out. Also, when using float: left;
or position: absolute;
the element is removed from the normal flow of the page. Try using top
and left
to position the image where you would like it.
Regards, Arkinder
The span has nothing to do with "achieving a presentational style", and it's hardly meaningless.
When using firebug to replace Twitter's search bar with yours - you can't click the magnifying glass to search, and since it's set as a background image for the input I can't use jQuery to make it clickable. Wow, I really wish I had another element that I could position over my search bar that has the magnifying glass in it or as a background image - that way I could click on it to search. On Windows, Leopard, and Ubuntu a magnifying glass is used to represent search, and that's just what I'm accustomed to. According to a study done by Seagate, in 2005, 76% of American's owned a personal computer. According to the CIA World Factbook there are an estimated 1,018,057,389 internet users worldwide - conducted in the year 2005. That's a lot of people accustomed to clickable images, and was 5 years ago.
7 months ago Twitter had 105 million registered users and counting. I highly doubt that they have novice programmers working for them, and doubt even more that any piece of their code is meaningless.
Regards, Arkinder
The magnifying glass used is from Wikipedia.org and can be found here.
Start with fixing all of your CSS errors. Copy and paste the CSS here. You will see that at the bottom of the page a valid form of your code is spit out. You have 30 HTML errors too, but none of them are affecting the page.
In IE6 something is overextending the li and/or the a - causing the ddcontainer to go down into your images. I think it may be from a lot of your comments not being ended in your CSS.
Since the boxes over the images are positioned relatively and the ddcontainer is positioned absolutely, they are both removed from the normal flow of the page, and will be listed from the bottom up in the order they are written. Putting your navigation after the images/boxes in your HTML is a possible fix. However, it will require reposition the navigation back to it's original place.
Or as Kraai said, you could simply move the boxes elsewhere. Regardless, there would still be an inconsistant "height" issue.
Regards, Arkinder
The vertical-align
property is for images, not text.
Regards, Arkinder
I don't see what you're talking about in Opera, and I don't have IE. I'll look at this more later when I have access to a PC. Could you possibly post a screen shot of the problem?
Regards, Arkinder
Another way,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#objectBar ul {
list-style-type: none;
}
#objectBar li {
display: inline;
padding: 5px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="objectBar">
<ul>
<li>First Object</li><li>|</li>
<li>Second Object</li><li>|</li>
<li>Third Object</li>
</ul>
</div>
<div id="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</body>
</html>
|
should be the HTML code, not the character itself. The text editor here automatically changes it, but it can be found here.height
.text-align: center;
to the ul rule.width
and add margin: 0 auto;
to the objectBar or the ul rule.float: left;
over display: inline;
, for whatever reason, a clear: left;
will be needed for the …The target attribute is becoming/is deprecated, and frames are just a bad idea. This was written two years ago, but remains accurate today.
The best way to accomplish this is through a scripting language such as JavaScript, or as VulcanDesign said, jQuery - a JavaScript library that takes away the long coding for animated web effects.
Regards, Arkinder
I understood what the poster wants, if you look at my post, you can see how to do exactly that with html. Basically it involves the link being a link to a hidden target on the same page, and you change the target to unhidden and the previous section to hidden when you do that. Again, take a look at the source code for the page I posted in my previous post....
Cheers!
HTML cannot change elements by itself. The link you provided is not purely HTML - jQuery is being used to show and hide the elements.
http://adkins-software.com/js/job.js
Regardless, it's an excellent example of what the poster wants. ^_^
Regards, Arkinder
I believe you both are miss reading the question. The user wants the content switched from, "Lorem Ipsum is simply dummy text of the printing and typesetting industry...." To the registration form when the user clicks a registration link.
HTML alone does not have the ability to replace elements via onclick.
Regards, Arkinder
I would recommend going through this tutorial.
Also, have a look at this while reading the rest of this post. I've included folders with examples for each part.
Start with the site folder (root folder). This is the folder holding of the documents for your web site (HTML, CSS, JavaScript, images, etc.) Inside of this folder you see they have index.html - this is your home page. They are using the .htm extension, it is exactly the same as .html. When going to a website the document named index is what the user will see first. So when you go to http://www.daniweb.com/ you're actually going to http://www.daniweb.com/index.php
Part 1
Next we have a folder called images. As the name implies this folder is where all of the web site's images will go. When linking to an image from your index.html page, or any web page inside of your site folder that is not in another folder, it's as easy as images/nameOfImage.jpg
For example:
<img src="images/nameOfImage.jpg" alt="Description of image." />
Part 2
Next there is a group of HTML files. These are the other pages in your site, such as: about.html, contact.html, news.html, etc. In the description it says "these files may be housed in folders". Which is very true, so let's say you made another folder called pages and placed the three HTML documents I mentioned earlier in it. Now inside of your site folder …
One moment I'm working on something to explain it to you.
The various parts of the site are being called from the server with PHP. What you posted isn't actually the HTML. You can always just view the pages source for the HTML, but as I said before - it's would be a rather tedious process.
Regards, Arkinder
Yes it should be written in CSS.
table {
text-align: center; /* this will replace the align: center; you have on your div. Note: it is not centering the div, but the a inside of it. */
}
.menu td { /* this selects all td that are inside of the element with the class menu */
width: 10%;
}
Now your HTML is,
<table>
<tr class="menu">
<td>
<div><a href="index.html">Home</a></div></td>
<td>
<div><a href="about.html">About us</a></div></td>
<td>
<div><a href="gallery.html">Gallery</a></div></td>
<td>
<div><a href="sponsors.html">Our Sponsors</a></div></td>
<td>
<div><a href="contact.html">Contact</a></div></td>
</tr>
</table>
Regards, Arkinder
You are missing a right brace, }, at the end of your .content rule. Also, align: center;
does not exist in CSS - align is a deprecated HTML attribute.
Regards, Arkinder
Hi David,
Use a p or div rather than a span. Text is an inline element and so is a span. For text-align
to work, it must be used on a block level element (p, div, etc.) to center the inline content.
Regards, Arkinder
No
Regards, Arkinder
Adrian Kiwee is correct. Twitter is using jQuery (a form of JavaScript) to make the span clickable. This is straight from Twitter.
<form id="search-form" action="/search" method="GET">
<span id="glass">
<i></i>
</span>
<input value="" placeholder="Search" name="q" id="search-query" type="text" />
</form>
The i tag has the magnifying glass as a background.
#search-form span.glass i {
background-image: url(http://s.twimg.com/a/1290538325/phoenix/img/sprite-icons.png);
background-position: -224px -96px;
display: block;
font-size: 0px;
height: 14px;
width: 14px;
}
and then the span is being absolutely positioned.
#search-form span.glass {
cursor: pointer;
display: block;
padding: 7px 8px 5px;
position: absolute;
right: 0px;
}
The input itself,
#search-form #search-query {
-webkit-box-shadow: #444 0px 1px 0px;
background: #666;
border: 1px solid black;
border-bottom-left-radius: 4px 4px;
border-bottom-right-radius: 4px 4px;
border-top-left-radius: 4px 4px;
border-top-right-radius: 4px 4px;
color: #CCC;
font: normal normal normal 13px/normal Arial, sans-serif;
padding: 6px 6px 4px;
width: 240px;
}
The form has a few stylings also but they are used to allow the search bar to play well with its surrounded elements.
Regards, Arkinder
*This is purely for educational purposes. Source: Twitter.com
I never said it wasn't. ^_^ I was referring to,
p {
align: center;
After that was just to clarify that aligning text is separate from aligning their containers, and elements in general.
Regards, Arkinder
My apologies for butting in - just a few things I noticed:
In previously posted HTML you have
src="../myfirstproject/images/genlogo.jpg"
Which tells me that your HTML document is not in the myfirstproject folder. Make sure that you are referring to your CSS file the same way you referred to your image.
<link rel="stylesheet" type="text/css" href="../myfirstproject/css/gen.css" />
When linking to anything its location will always be relative to the HTML document. Also, there are three invalid CSS properties.
a {
float: center;
width: 180px;
text-decoration: none;
color: white;
font-weight: bold;
background: #0000CD;
border-right: 1px solid #FFFFFF;
}
float: center;
is not a real value. Elements can only be floated left or right.
body {
bgcolor= #FAEBD7;
}
bgcolor does not exist in CSS. Use the background-color: #FAEBD7;
property instead.
p {
align: center;
color: #800000;
text-align: justify;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
align does not exist in CSS. For the text to be centered use text-align: center;
. There are several ways to have the paragraph itself centered, but which to use depends on the paragraph's surrounding elements, and their CSS.
Regards, Arkinder
I expected as much but was hoping otherwise. To make the post look the same, you will need to edit the HTML to match the "Post" section and one or two others in the second template's CSS. It will require tedious repetition, a lot of going back and forth, and is something I can't really help you with. Unless of course you can just paste the correct HTML over, then it's a matter of finding the right CSS to add.
Regards, Arkinder
Help yes, do it for you - no. Post the CSS from the other template also.
I apologize, I thought you were referring to the left gap from the advertisement. A different template means different stylings for the table when you post. It's just part of the template and changing it would require access to the CSS.
Regards, Arkinder