Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=djjkps3;31537009]I want to put a 1 pixel border around certain images on my webpage. In the CSS I have
[code]
#gallery img {
width: 150px;
height: 150px;
border: 1px solid #000;
}
[/code]
And in the html I have
[code]
<img id= "gallery" src = "gallery/thumb1.png" />
[/code]
But it doesn't work, anyone help me with this basic question?[/QUOTE]
Use a class like so:
CSS
[code]
.gallery_img{
width: 150px;
height: 150px;
border: 1px solid #000;
}
[/code]
HTML
[code]
<img class="gallery_img" src="gallery/thumb1.png" />
[/code]
What you had initially could work as well, all you need is a parent with the id of gallery
[html]
<div id="gallery">
<img src="gallery/thumb1.png" />
<img src="gallery/thumb2.png" />
<img src="gallery/thumb3.png" />
</div>
[/html]
[QUOTE=leach139;31532551]I'd prefer to avoid storing a static salt in a static location unless I absolutely have to, as a last defense if someone got file access (this is probably sounding incredibly stupid)[/QUOTE]
If they have access to your code/database, all the salts in the world won't help you. And if you don't supply a salt to crypt(), it will generate one based on the input string and system settings, so if the settings ever changes down the road, it'll invalidate all your passwords.
Using a known salt with a known method (like HMAC-SHA) will still be secure, and doesn't have the possibility of randomly changing in the future.
[QUOTE=leach139;31532551]I'd prefer to avoid storing a static salt in a static location unless I absolutely have to, as a last defense if someone got file access (this is probably sounding incredibly stupid)[/QUOTE]
Use a random salt for each user. Use bcrypt for hashing.
As secure as it gets.
[QUOTE=tanraga;31482686]kids here don't have living expenses so they can do cheap and nasty shit[/QUOTE]
Whether or not you have living expenses should have no bearing on what your time is worth. That's dictated by your skill set/level and what the market will bear.
[QUOTE=djjkps3;31537009]I want to put a 1 pixel border around certain images on my webpage. In the CSS I have
[code]
#gallery img {
width: 150px;
height: 150px;
border: 1px solid #000;
}
[/code]
And in the html I have
[code]
<img id= "gallery" src = "gallery/thumb1.png" />
[/code]
But it doesn't work, anyone help me with this basic question?[/QUOTE]
It doesn't work because the CSS rule targets "every image within an element with ID 'gallery'". If you want it to tag an image with ID gallery you'd formulate it as img#gallery. CSS can be nasty at times, but once you get your head around it, you'd often wish other things would be so clear and well behaving.
[QUOTE=Kirth;31548954]It doesn't work because the CSS rule targets "every image within an element with ID 'gallery'". If you want it to tag an image with ID gallery you'd formulate it as img#gallery. CSS can be nasty at times, but once you get your head around it, you'd often wish other things would be so clear and well behaving.[/QUOTE]
only one element can have the same id, I believe
[QUOTE=Ac!dL3ak;31548988]only one element can have the same id, I believe[/QUOTE]
This is true. If you want multiple images with the CSS rule you should make it a class (img.gallery) instead.
IDs are "unique", which in reality means you can use them as many times as you want on the same page (And some APIs will handle multiple elements with the same ID, while some will only ever use the first in the DOM)
Any issues with using this method?
[url]http://jsfiddle.net/dxjva/[/url]
2 column layout. Left column stretches with window size, right column stays at 300px.
well depends on how much space of the purple part you are going to use. watch out for smaller screens.
[QUOTE=zzlawlzz;31554688]well depends on how much space of the purple part you are going to use. watch out for smaller screens.[/QUOTE]
Yeah, that's pretty much my issue. Probably 800x600 minimum for the top left...
Time to play around with different resolutions and overflows :D
[QUOTE=KmartSqrl;31548035]Whether or not you have living expenses should have no bearing on what your time is worth. That's dictated by your skill set/level and what the market will bear.[/QUOTE]
People who don't have living expenses tend to sell themselves lower then ones with them. Probably because it's a better chance of getting a client and a better chance at making some money.
Does anyone know a better way to style/layout forms without using tables?
[QUOTE=Jelly;31562625]Does anyone know a better way to style/layout forms without using tables?[/QUOTE]
labels and inputs
nevermind i'm retarded, give me boxes
also fuck semicolons
[QUOTE=Jelly;31556702]People who don't have living expenses tend to sell themselves lower then ones with them. Probably because it's a better chance of getting a client and a better chance at making some money.[/QUOTE]
It's a good way to fuck yourself in the long run by only teaching yourself how to compete on price instead of learning to compete based on what you bring to the table over those who charge less than you.
Does php have the temp variable thing that JS has? ( variable.split()[23].append(obj) )
[QUOTE=Giraffen93;31574784]Does php have the temp variable thing that JS has? ( variable.split()[23].append(obj) )[/QUOTE]
no, you'd have to do something like this for that to work:
[code]
$variable = explode("",$variable);
$variable = do_something($variable[23]);
[/code]
I think, not sure if that'll even work
[QUOTE=Ac!dL3ak;31575830]no, you'd have to do something like this for that to work:
[code]
$variable = explode("",$variable);
$variable = do_something($variable[23]);
[/code]
I think, not sure if that'll even work[/QUOTE]
Yeah i know, but it'd be neat if PHP had something built in, it's so much prettier!
[QUOTE=Giraffen93;31576019]Yeah i know, but it'd be neat if PHP had something built in, it's so much prettier![/QUOTE]
It's called Perl, man :D. All sillyness aside, there have been quite a lot of bugreports/suggestions to implement it. Maybe.. one day.
nevermind, figured it out
so if i wanted to start learning web design, how long would it be before i see results? i've tried before, but i could never learn much more than html tags.
[QUOTE=pdp;31596719]so if i wanted to start learning web design, how long would it be before i see results? i've tried before, but i could never get past learning html tags.[/QUOTE]
How long does it take to ride a bike? It varies between people.
[QUOTE=Jelly;31597804]How long does it take to ride a bike? It varies between people.[/QUOTE]
eh. i don't know. i just like having that kind of information or else i feel like i'm permanently stuck as a beginner.
[QUOTE=pdp;31598145]eh. i don't know. i just like having that kind of information or else i feel like i'm permanently stuck as a beginner.[/QUOTE]
As I said it varies so we can't tell you.
[QUOTE=pdp;31596719]so if i wanted to start learning web design, how long would it be before i see results? i've tried before, but i could never get past learning html tags.[/QUOTE]
It took me about a week to get down with the basics (HTML, CSS and some basic PHP). Within a month I was very proficient with xHTML/CSS and could get around PHP. It took me several more months to (more or less) fully comprehend how the web is built, how it works and how to write webscripts/webapps.
Obviously these aren't full months spent on the subject, but the timespan in which I was actively learning (a lot) about the subjects.
You can learn to use HTML / CSS in a week. Learning to design however can take months to get a vague understanding, and after years you're still nowhere near done learning.
As with most things, it just takes practice, and lots of it. You can nail down the basics pretty quick, but it's one of those 'easy to learn, hard to master' type of things.
It only took me a couple of weeks to understand HTML and CSS, but six to eight months later, I found that I had learned so much more about how to code efficiently and semantically; I had cut down on superfluous divs and was more conscious of what tag I was using for what, I was becoming more concerned with best practices, etc. etc.
Design is a different beast altogether, but similarly, relies on lots and lots of practice. Make sure to treat design separately to HTML and CSS and spend time learning both, if you want to be able to design as well as code markup.
The quality of my work made a huge leap in a year, both in terms of design and my grip on HTML and CSS. I can see marked improvements on my work from 2 years ago, a year ago, and even six months ago. No matter how long you've been doing web design and development, you'll always be learning new things.
Ah. Well, I'd say I have an alright eye for what looks good and what doesn't, because I've been lurking this section for a year or so. I just really have no knowledge of writing HTML or CSS. Once I get the chance, I'll start learning again. I hate not being able to adequately create what I have in my head because of my lack of skills, so it discourages me from continuing. :v
Sorry, you need to Log In to post a reply to this thread.