Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
Ah yeah I guess that makes sense, thanks. I must have assumed it just used up 1px of the 1000px for the border.
You can use
[code]
box-sizing: border-box
[/code]
if you don't want to calculate the difference.
I always feel my designs start suck before I even get that far into one.
[QUOTE=Funcoot;32103062]I always feel my designs start suck before I even get that far into one.[/QUOTE]
ye, i know
Simple question for you 'folks, I am new (and I mean totally new) to website design. Completely 100%.
So, I made my design in photoshop;[QUOTE]
[IMG]http://dl.dropbox.com/u/1467131/Tja.jpg[/IMG][/QUOTE]
However, I can't figure out how to center the text under each individual logo within the same wrapper tag. (as in 'foto' under the logo of the camera and such)
Or how to make wrapper tags be next to each other.
[QUOTE=mac338;32107490]Simple question for you 'folks, I am new (and I mean totally new) to website design. Completely 100%.
So, I made my design in photoshop;
However, I can't figure out how to center the text under each individual logo within the same wrapper tag. (as in 'foto' under the logo of the camera and such)
Or how to make wrapper tags be next to each other.[/QUOTE]
display: inline-block;
text-align: center;
[QUOTE=Jelly;32107892]display: inline-block;
text-align: center;[/QUOTE]
Uh, well, I did this and all it did was align to the center, and not the logo. I'm sure I'm missing something blatant here, but do you care to elaborate this a bit?
[QUOTE=mac338;32108095]Uh, well, I did this and all it did was align to the center, and not the logo. I'm sure I'm missing something blatant here, but do you care to elaborate this a bit?[/QUOTE]
I really don't understand what you want to do.
[QUOTE=Jelly;32108135]I really don't understand what you want to do.[/QUOTE]
I want (pictured above)
I get this; [url]http://dl.dropbox.com/u/1467131/Maple_Media/Index.html[/url]
As in, the icons are not aligned horizontally, and I'd like for it to be text under each individual icon.
[img]http://img13.imageshack.us/img13/6544/donateu.png[/img]
Does anyone have any idea how I would even start that? I've no experience with paypal's API
I'm presuming I'd use their add to cart API?
Do you think HTML would be good for a begginer?
[code]<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>JavaScript Demo</title>
</head>
<body>
<script>
function repaint(player_position, x_size, y_size)
{
document.body.innerHTML = "";
for(var y = 0; y < y_size; y++)
{
for(var x = 0; x < x_size; x++)
{
if(x === (player_position[0] - 1) && y === (player_position[1] - 1))
{
document.write("<div class=\"player_tile\"></div>");
}
else
{
document.write("<div class=\"tile\"></div>");
}
}
document.write("<div class=\"clear\"></div>");
}
}
var x_size = 10;
var y_size = 5;
var player_position = [3, 2];
repaint(player_position, x_size, y_size);
var player_position = [4, 2];
setTimeout( "repaint(player_position, x_size, y_size);", 1000);
</script>
</body>
</html>[/code]
Anyone know why it won't work? It paints up the board at first, but then goes blank after one second (1000 milliseconds), but doesn't repaint it. I'm new to JavaScript, so bare with me!
[QUOTE=theJohn;32113284][code]<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>JavaScript Demo</title>
</head>
<body>
<script>
function repaint(player_position, x_size, y_size)
{
document.body.innerHTML = "";
for(var y = 0; y < y_size; y++)
{
for(var x = 0; x < x_size; x++)
{
if(x === (player_position[0] - 1) && y === (player_position[1] - 1))
{
document.write("<div class=\"player_tile\"></div>");
}
else
{
document.write("<div class=\"tile\"></div>");
}
}
document.write("<div class=\"clear\"></div>");
}
}
var x_size = 10;
var y_size = 5;
var player_position = [3, 2];
repaint(player_position, x_size, y_size);
var player_position = [4, 2];
setTimeout( "repaint(player_position, x_size, y_size);", 1000);
</script>
</body>
</html>[/code]
Anyone know why it won't work? It paints up the board at first, but then goes blank after one second (1000 milliseconds), but doesn't repaint it. I'm new to JavaScript, so bare with me![/QUOTE]
my guess is that when you do this:
[code]
setTimeout( "repaint(player_position, x_size, y_size);", 1000);
[/code]
it doesn't evaluate like that, try this:
[code]
setTimeout( "repaint("+player_position+","+x_size+","+y_size+");", 1000);
[/code]
[QUOTE=commander204;32113635]my guess is that when you do this:
[code]
setTimeout( "repaint(player_position, x_size, y_size);", 1000);
[/code]
it doesn't evaluate like that, try this:
[code]
setTimeout( "repaint("+player_position+","+x_size+","+y_size+");", 1000);
[/code][/QUOTE]
I got the same issue after trying that.
[QUOTE=theJohn;32113727]I got the same issue after trying that.[/QUOTE]
This works:
[code]
function repaint(player_position, x_size, y_size)
{
document.body.innerHTML = "";
for(var y = 0; y < y_size; y++)
{
for(var x = 0; x < x_size; x++)
{
if(x === (player_position[0] - 1) && y === (player_position[1] - 1))
{
document.write("<div class=\"player_tile\"></div>");
}
else
{
document.write("<div class=\"tile\"></div>");
}
}
document.write("<div class=\"clear\"></div>");
}
}
function paint(){
repaint(player_position,x_size,y_size);
}
var x_size = 10;
var y_size = 5;
var player_position = [3, 2];
repaint(player_position, x_size, y_size);
var player_position = [4, 2];
setTimeout( paint, 1000);
[/code]
I try to evade any evaluation anyway too much of a headache.
[QUOTE=mac338;32108203]I want (pictured above)
I get this; [url]http://dl.dropbox.com/u/1467131/Maple_Media/Index.html[/url]
As in, the icons are not aligned horizontally, and I'd like for it to be text under each individual icon.[/QUOTE]
why do you have the images wrapped in <p> tags?
[QUOTE=mac338;32108203]I want (pictured above)
I get this; [url]http://dl.dropbox.com/u/1467131/Maple_Media/Index.html[/url]
As in, the icons are not aligned horizontally, and I'd like for it to be text under each individual icon.[/QUOTE]
Your icons have a 30px right margin, which takes up space and it doesn't fit into the parent element.
[code]<link rel="stylesheet" type="text/css" src="style.css" />[/code]
Why is the browser not recognizing this? It's not applying the stylesheet, and yes it is in the proper directory and the name is correct.
It should be
[code]
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=all>
[/code]
href and not src
[QUOTE=commander204;32114870]It should be
[code]
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=all>
[/code]
href and not src[/QUOTE]Thanks :v:
You don't need the type attribute, unless you're working with a browser that supports something other than CSS.
Why they didn't just make it <style src=""></style> like <script>.
[QUOTE=Jelly;32122559]Why they didn't just make it <style src=""></style> like <script>.[/QUOTE]
that's what I was wondering it would make it much more simpler
<link> makes more sense from a semantic standpoint (you're linking a document and it's styles together), it's the standard way for linking these things together (page and it's favicon, table of contents, etc.)
<script> seems like <marquee> or <blink> to me, a custom tag added to achieve a single purpose (and since browsers have treated it differently, you can't self-close it, so you always need to include </script>, even when linking to an external resource)
It should be <script src="" /> and <style src="" />
Simple.
[QUOTE=TheDecryptor;32122750]<link> makes more sense from a semantic standpoint (you're linking a document and it's styles together), it's the standard way for linking these things together (page and it's favicon, table of contents, etc.)
<script> seems like <marquee> or <blink> to me, a custom tag added to achieve a single purpose (and since browsers have treated it differently, you can't self-close it, so you always need to include </script>, even when linking to an external resource)[/QUOTE]
If that's the case then <link> makes more sense from a semantic standpoint instead of <img> as you're linking the content to it's relevant images together.
-snip- post below next
[QUOTE=Jelly;32123435]If that's the case then <link> makes more sense from a semantic standpoint instead of <img> as you're linking the content to it's relevant images together.[/QUOTE]
They were going to drop <img> completely in XHTML2, and just have it as an attribute on other elements (so you could have a <p> tag, optionally replaced with an image), but since XHTML2 died (no browser would have implemented it), that idea is dead with it.
Edit: HTML has grown organically over the past 2 decades, a lot of bad design ideas and bugs are now so ingrained that they can't be changed or dropped.
Does anyone know how to close all divs that have been opened with slideDown() in jQuery?
Or if it's not possible a way to do multiple statements in a single line?
jQuery:
[code]
if ($("#History").is(":hidden")) {[/code]
in PHP it would be something like
[PHP]
if($var = 2 || $var = 3){
[/PHP]
(haven't worked with PHP in a while, may not be correct.
Sorry, you need to Log In to post a reply to this thread.