Silkroad Online Forums

A community forum for the free online game Silkroad Online. Discuss Silkroad Online, read up on guides, and build your character and skills.

Faq Search Members Chat  Register Profile Login

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: HTML Help.
PostPosted: Wed Jul 20, 2011 7:18 pm 
Retired Admin
User avatar
Offline

Joined: Jun 2006
Posts: 8238
Location: twitch.tv/AFKidsGaming
Hey Guys,

I'm working on a project using HTML, it's very basic HTML, and i've pretty much finished, but im stuck on one bloody thing.

So, basics:

I have 1 big Background Image. 512 by 1000
Over that background, i'm placing 2 Smaller images that will have hyperlinks.
At the bottom, i have a Youtube embed.

Now, so far everything is working fine. The only problem is, that when i place the Smaller image with the hyperlink in, the "click-able area" goes from the top left corner of the background, to the bottom right corner of the little image.

I need to know how to make the "click-able" area only the small image.

This is the code i currently have written, to keep it more simple i've taken out the 2nd image, and just using the top image till if find out how to make the correct "click-able" area.

Spoiler!


Here is a HTML tester if you guys want to see it in use.
http://www.w3schools.com/tags/tryit.asp ... image_test

Any help is super appreciated. Thanks!

_________________
Image



Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Wed Jul 20, 2011 9:52 pm 
Addicted Member
User avatar
Offline

Joined: Feb 2007
Posts: 2568
Location:
Venus
I would have to be able to see the page on my browser and view the source from that.

I find it hard to understand from just words.


But one thing you do need to learn to do is seperate your HTML and CSS files. Putting styling in the same file as your HTML is very bad practice and makes everything a lot harder to work with.


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 1:18 am 
Retired Admin
User avatar
Offline

Joined: Jun 2006
Posts: 8238
Location: twitch.tv/AFKidsGaming
With the HTML tester you can see the page, and the issue im having.

Just paste the code i provided above onto the right, and generate it.

Also, i know im new at HTML, but what do you mean by separate your CSS and HTML?

_________________
Image



Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 1:46 am 
Advanced Member
User avatar
Offline

Joined: Jul 2007
Posts: 2341
Location: Limbo
Image
everything in yellow goes in CSS file.
another issue is that you're using "background" as your content.
if you're still planning on using images to completely compose your content then splice it up in photoshop or something.





Code:
<link rel="stylesheet" type="text/css" href="style.css" />

this brings your CSS file in.
The above code would go in between
<head></head>



I don't think <iframe> is recommended either.



I have a fairly limited knowledge in Web development as well so what I'm saying may or may not be true.

_________________
My attention span is


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 2:38 am 
Ex-Staff
User avatar
Offline

Joined: Jan 2008
Posts: 2761
Location: /wave
It's cause you're spacing the image with padding, and yeah, iframe has security issues.

Fixed code:

Code:
<div style="width:515px; height:1000px; padding:0px; margin:0px auto; font-family:'Times New Roman', Times, serif; font-size:14px; color:#b4c0c3; text-align:left; background: url(http://img269.imageshack.us/img269/4802/fyesplashbrand.png) no-repeat left top">

<div style="padding-top:240px; padding-left:307px"><a href="http://www.ubc.ca/okanagan/students/newtoubc/fye.html" target="_blank">
<img src="http://img585.imageshack.us/img585/9895/aboutlinkbord.jpg"></a></div>

<div style="padding-bottom:10px; padding-top:250px"><center><iframe width="450" height="370.5" src="http://www.youtube.com/embed/ooj33ffM6ps" frameborder="0" allowfullscreen></iframe></center></div>
</div>


Oh, if for some reason you're inclined to not want to use another div for the image, just replace padding with the word margin, margin is outside the object, padding is inside, when you pad the bounding box gets bigger, when you use margin the bounding box moves. Actually, every time you've used padding, you probably mean margin.


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 2:42 am 
Global Moderator
Global Moderator
User avatar
Offline

Joined: Mar 2006
Posts: 9967
Location: västkustskt
No way in hell would this be the proper way to do it, but I think this is what you wanted while keeping what you wrote:

Code:
<div style="width:515px; height:1000px; padding:0px; margin:0px auto; font-family:'Times New Roman', Times, serif; font-size:14px; color:#b4c0c3; text-align:left; background: url(http://img269.imageshack.us/img269/4802/fyesplashbrand.png) no-repeat left top">

<div style="padding-top:240px; padding-left:307px"><a href="http://www.ubc.ca/okanagan/students/newtoubc/fye.html" target="_blank">
<img src="http://img585.imageshack.us/img585/9895/aboutlinkbord.jpg" ></a>
</div>

<div style="padding-bottom:10px; padding-top:250px"><center><iframe width="450" height="370.5" src="http://www.youtube.com/embed/ooj33ffM6ps" frameborder="0" allowfullscreen></iframe></center></div>
</div>


EDIT: :rant: , I took a while because I originally started rewriting it properly but then said **** it.

_________________
Image


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 2:45 am 
Ex-Staff
User avatar
Offline

Joined: Jan 2008
Posts: 2761
Location: /wave
y u copy my answer and pass it off as ur own?


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 3:09 am 
Forum Legend
User avatar
Offline

Joined: Feb 2007
Posts: 7363
Location: N/A
I used that html tester a couple times and half the time my product looks different on localhost than it does on that.

_________________
Image


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 3:22 am 
Retired Admin
User avatar
Offline

Joined: Jun 2006
Posts: 8238
Location: twitch.tv/AFKidsGaming
Thank you guys so much, it was honestly killing me.

Seriously appreciate the help.

And i just used the iFrame only because that's what is provided by youtube, im definitely not a master, not even a "Novice" at HTML coding, i just know how to use it slightly, and be able to do things, so honestly its appreciated.

_________________
Image



Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Thu Jul 21, 2011 7:54 am 
Forum God
User avatar
Offline

Joined: Aug 2006
Posts: 8834
Location: Age of Wushu
The structure of your page is bad. You shouldn't use padding to position an element. Use divs and float to position them correctly

_________________
Playing Age of Wushu, dota IMBA


Top
 Profile  
 
 Post subject: Re: HTML Help.
PostPosted: Fri Jul 22, 2011 2:14 pm 
Forum Legend
User avatar
Offline

Joined: Feb 2007
Posts: 7363
Location: N/A
Key-J wrote:
Thank you guys so much, it was honestly killing me.

Seriously appreciate the help.

And i just used the iFrame only because that's what is provided by youtube, im definitely not a master, not even a "Novice" at HTML coding, i just know how to use it slightly, and be able to do things, so honestly its appreciated.

I hardly do either, but for some reason we have like 1 class that teaches it(non-required) and like 3 required that focus on Java.. wtf. They assume if your going to school for that, you taught yourself.. Why the hell do you think I'm going to school? Certainly not to learn something I already know.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 48 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group