Jump to content

Display dashed border 1/2" INSIDE an image??


suess0r

Recommended Posts

Hello there,

 

I'm dynamically calling an image from the server in which the user has uploaded from the form before.

 

I want to display a dashed border approximately 1/2" or 37px INSIDE the image (to show bleed space)

 

Here's how I was trying to do this

 

<?php

  $filename = $_POST['name'];

  echo "<img src='/files/new/".$filename."' width='450' height='300' style='border: dashed; padding: -37px -37px -37px -37px;'>";

          ?>

 

The only thing is that it adds the dashed border around the OUTSIDE of the image - Is there anyway of keeping this within the image? I know that it's kinda sloppy to add the CSS in the img src tag, and if you don't speak php this is what it means in html

 

<img src="/files/new/filename.jpg" width="450" height="300" style="border: dashed; padding: -37px -37px -37px -37px;">

 

Appreciate the help!!!

Link to comment
Share on other sites

What about this kind of "solution"...apart from the extra markup is there anything to prevent this (and other variations) from being a consideration? ToonMariner might be able to highlight the pitfalls of this approach.

 

/*css*/
.image_450x300 {position:relative; width:450px; height:300px;}
.image_450x300 span {position:absolute; top:37px; left:37px; display:block; width:376px; height:226px; border:1px dashed #fff;}

 

<!-- xhtml -->
<div class="image_450x300">
   <span></span>
   <img src="image.jpg" alt="" />
</div>

Link to comment
Share on other sites

nope its correct - you could just use this for the span style (would allow you to use for any size image - if you needed it that is and the 450x300 was not there!)

 

.image_450x300 span {position:absolute; top:37px; left:37px; right: 37px; bottom: 37px; border: 1px dashed #fff;}

 

u'll hvae to check it in a few browsers but that should do teh trick quite nicely (nice soln monkey)

Link to comment
Share on other sites

Toonmariner, unfortunately the absolute positions trick for all photo sizes doesn't work in IE6. A List Apart had an article about using all 4 positions for layout, and no doubt it is going to be used many layouts and designs once IE6 is dead and buried, but for now it requires a Javascript (in essence) fix for IE6 - http://www.alistapart.com/articles/conflictingabsolutepositions.

Link to comment
Share on other sites

IE6 remains because many businesses are stuck with it given the nature of the XP OS that they are using. Only when they switch all their computers over to Vista will the need for IE6 support rapidly fade.

 

Until MS make efforts for their platform/browser to undergo regular updates/upgrades (like the Firefox/Opera browsers), we will always be sitting around waiting for the next version of IE to rectify "bugs" and adopt the latest W3C standards.

Link to comment
Share on other sites

Hmm? IE7 works fine in XP. I'm using XP right now and IE7 is fine. Even in the 64bit version.

And it's definitely less buggy then IE6.

 

I can't think of any valid excuse for somebody not to update to IE7. There is every reason to and no reason not to.

 

Better yet, upgrade to Firefox or Opera or something. Why do people still use IE nowadays? It died a long time ago.

Link to comment
Share on other sites

A lot of businesses are using XP SP1 and, as far as I know, you can't use IE7 with SP1. Like I said, it is the combination of the slow pace at which businesses upgrade their computers and the slow pace at which IE gets updated (due to it being a platform).

 

You also can't expect IE in general to "die", because it is the default and pre-packaged way to browse the internet from a PC. In addition, there are still many sites (including those of major companies) that only work properly in an IE browser. A lot of PC owners are never going to think to look for Firefox/Opera either.

 

Anyway, the point is that when IE6 in business environments is replaced by IE7, everyone's life is going to get a bit easier. Having said that, there are still people using box model hacks for IE5.5...so it is also important for people to stop trying to get their sites to work in rarely used browsers, as it only discourages people from making simple upgrades to more standards-compliant browsers.

Link to comment
Share on other sites

the only reason that ie 6 is still around is becaue there are so many hooky copies of XPstill running.

 

If MS want to decent thing they shoudl let ie7 be installed on these machines - the posibility that these people ill actually pay for a valid lisence is 0 so why not just cut the losses, make ie7 an essential update and consign ie6 to where it belongs.

 

If vista were actually any good I'd consider switching over - fact is it isn't that good an to get the best out of it you neede A LOT of good hardware..

Link to comment
Share on other sites

Really, it is down to businesses with XP SP1 - they cannot upgrade to IE7. They will adopt IE7 when they upgrade their computers to Vista, which will begin when Vista SP1 is released.

 

Vista is also a pretty good OS. You don't need excessive hardware to run it - I bought a new PC for £300 and it comfortably runs Vista (and several copies of XP in a virtual environment).

Link to comment
Share on other sites

IE 6 will be around for a long time. There are still WAY too many win 98, win ME and Win 2k users out there.

 

The only thing that will kill IE6 is when web coders like us stop catering to it.

 

I still show @ 200 visitors a month who are actually still using IE 5.5!! Up until a year ago I was still testing (and adjusting) my layouts to work with IE 5.5. But like most web coders, I decided to drop it. Since most web coders don't even bother trying to accommodate IE 5.5 anymore, I'm sure those people with win '98, ME or 2k will be forced to at least upgrade to IE 6.0 (if not xp or GAK! Vista).

 

I personally would rather jam hot spikes in my eyes than even boot up a machine with Vista. When XP is no longer supported, I will switch to a Mac instead of coming within a keystroke of owning any Vista machine.

 

And, I'm not alone. After MASSIVE demand, both Dell and Tiger direct now offer XP as an alternate OS, instead of forcing people to spin the Vista version wheel.

Link to comment
Share on other sites

A lot of businesses are using XP SP1
Maybe I ask WHY the hell anyone in their right mind would not upgrade to SP2? Obviously you refuse to update your computer it's not going to work with new stuff. That's a given. And when it's completely free and can be done completely automatically.. only an utter FOOL would refuse to. Unless they have that "OMIGAWD SP2 WIL MEZ UP MI COMPUTAR LULZ" superstition. In which they are need to die before the gene pool is corrupted.
Link to comment
Share on other sites

Unless they have that "OMIGAWD SP2 WIL MEZ UP MI COMPUTAR LULZ" superstition.

 

You obviously never underwent the horror that was the initial release of SP2. Some superstition is based on facts.

 

A business doesn't have the time to waste. We have over 200 pcs. When SP2 first came out, after downloading, installing, trying to debug all the many and varied problems (only to discover that SP2 was causing them) then uninstalling it, we decided to stick with SP1.

 

When MS finally got their act together a year ago and fixed the SP2 problems, it wasn't worth the wasted man hours trying it again. We tightened up our servers and firewall and have been fine ever since.

 

Personally, I have no issue with SP2. Win XP is the most stable OS MS ever released. But a business doesn't need to waste time when what they have works just fine. For business purposes, we don't need IE 7 anyway.

 

Link to comment
Share on other sites

Unless they have that "OMIGAWD SP2 WIL MEZ UP MI COMPUTAR LULZ" superstition.

 

You obviously never underwent the horror that was the initial release of SP2. Some superstition is based on facts.

 

A business doesn't have the time to waste. We have over 200 pcs. When SP2 first came out, after downloading, installing, trying to debug all the many and varied problems (only to discover that SP2 was causing them) then uninstalling it, we decided to stick with SP1.

 

When MS finally got their act together a year ago and fixed the SP2 problems, it wasn't worth the wasted man hours trying it again. We tightened up our servers and firewall and have been fine ever since.

 

Personally, I have no issue with SP2. Win XP is the most stable OS MS ever released. But a business doesn't need to waste time when what they have works just fine. For business purposes, we don't need IE 7 anyway.

 

HUH. Interesting. Well, SP2 works fine now, and there is absolutely no "time to waste" necessary. Just don't waste time by disabling automatic updates! It will update automatically on it's own. You don't have to do shit. And IE6 obviously DOESN'T "work just fine" or Microsoft would not have spent god knows how much money creating and releasing IE7! They aren't just "bumping the version number for the fun of it" you know.. not with this release anyways..

 

To summarize it;

SP2>SP1

IE7>IE6

 

You haven't said ANY REAL REASONS WHATSOEVER as to why somebody would prefer IE7, besides "laziness" which isn't even true unless somebody wasted time purpousfully turning off automatic updates.. which they wouldn't do if they were lazy, anyways.

 

DIE IE6, DIE!

 

All heil modern browsers.

Link to comment
Share on other sites

LOL.

 

PLEASE do not call IE 7 a "modern" browser. Sure it has tabs. But it still is not a web standards compliant browser. It is ONLY marginally better than IE 6 and now requires conditional comments instead of css "hacks" - same girl different dress.

 

Funny how MS saw fit to fix the bugs that allowed us to use hacks, but didn't fix the issues that required the hacks in the first place. Hmmm ...

 

BUT, I do indeed concede that it is better for the average Joe to have SP2 than SP1 for security reasons. But anyone who actually prefers IE to Firefox just "doesn't get it". The ONLY reason to use IE, as usual, is because it is already there.

 

Frankly, I prefer IE6 only so I can be sure that my conditional comments are working (if they work in 6 they work in 7).  I never use IE for anything other than checking my site layouts anyway.

 

Link to comment
Share on other sites

LOL.

 

PLEASE do not call IE 7 a "modern" browser.

Please don't get me wrong! I hate internet explorer! But somebody voiced a concern about something not working in IE6, and was considering messing with their website to ensure it works right in IE7.

 

I'm just trying to say, screw IE6, using internet explorer is one thing, but using a stone-aged version of it is just unforgivable, and anyone using it should expect problems. Just like if someone is using windows 95, they should expect problems. No need to go out of your way and mess with your stuff to make sure stone-age stuff can run it. That leads to very ugly/bloated/non-compliant/tag soup code..

Link to comment
Share on other sites

But then most users don't know it's old technology-now, if you were talking about IE5, then I agree with you wholeheartedly, but IE6 is still common because of users who don't know about updating, like my parents or my grandmother-they didn't grow up with the tech, like most everyone in their generation, so they don't know much about it.

Link to comment
Share on other sites

You're right, Azu. For three years I fought balancing my code to accommodate IE 5.3 for Mac and 5.5 for win AND IE 6.

 

Luckily, ALL coders stopped trying to deal with the IE 5s. Because people with win 98 and win 2k COULD download IE 6.

 

The problem today is that IE 7 ONLY works in XP SP2 or Vista. So the people still using win 98, ME, NT and 2k (and there are still Millions of them worldwide) are only able to "upgrade" to IE6.

 

It will be at least another three to four years (if not longer) before these OSs are as hugely obsolete as win 95.

 

Unfortunately Moberemk is correct. My Father-in-law is 81 and still uses his old blue and white i-mack that he bought in '98 ... with Apple OS 8, AOL 7 that uses IE 4!!!

 

LOL, He can't understand why all websites started looking so strange in 2003 or how I get paid so much for making websites that "all the people with i-macs, like me" can't look at.

 

In his mind, it is a perfectly good computer that's less than 10 years old and cost him $1500! Of course, he still has transistor radios from the '60s and a blender from 1949, yet, LOL, he has a brand new 2007 Toyota.

 

 

Link to comment
Share on other sites

Oh.. I thought IE7 worked on all Windows, and that windows update automatically gets the updates by default.. sorry guess I was wrong lol..

 

I still think IE6 needs to go, though. If they can't use IE7, why not switch to Firefox or Opera? IE7 is the only IE that even starts to almost become CLOSE to half as good as them..

Link to comment
Share on other sites

>>I still think IE6 needs to go, though. If they can't use IE7, why not switch to Firefox or Opera? IE7 is the only IE that even starts to almost become CLOSE to half as good as them..<<

 

That's a good question. AND, it is the number 1 most relevant question.

 

Know what the answer is?

 

Because Microsoft has always bundled IE with Windows. And this is what started the browser wars of the mid '90s, as well as the Monopoly lawsuits against MS (by Netscape).

 

But even though MS lost the Monopoly cases, they never stopped their practices. And THIS is why people who know better started to hate Microsoft (myself included).

 

People are either ignorant of a choice or too lazy to "learn something new".

 

They use IE because its already there.

Link to comment
Share on other sites

But people don't mind replacing the games that come bundled with Windows (solitaire) with third party games (UT2004)..

 

Or the image editor that comes bundled with Windows (mspaint) with third party image editors (photoshop)..

 

And probably lots of other things to.. so why not browsers? I don't understand at all =/

Link to comment
Share on other sites

You make an extremely valid point. But you will be amazed at the answers people give for using IE.

 

The main reason, though, is because they don't know that there IS an alternative.

 

The next reason is "I'm used to IE".

 

Another is (believe it or not) I trust Microsoft.

 

And the one that pisses me off most is that, until recently, most top commercial utility sites like Mcafee, Norton, Cable internet connection sites and others actually REQUIRED IE.  I personally think it is because only IE will arbitrarily allow them to install their stealth, auto updates root-kit/adware scripts.

 

It amazes me how many top entertainment and corporate websites still use old, quirks mode garbage HTML soup that only IE can display.

 

And THAT is also the most important reason why we all, as web developers, MUST start using web standard, non-IE proprietary code. So long as professionals create junk code ... Microsoft wins.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.