Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Coding Your Html/css File For Swishmax, CSS - Beginner
RedDragon
post Mar 4 2005, 05:33 AM
Post #1


insert coin
Group Icon
Group: Main Team
Posts: 5,344
Joined: 24-May 04
From: Maastricht
Member No.: 35





Here I'll show you how I coded my html page in order to get a result like this: click

You see I have a background image with a centered area with a solid colour. The swf is placed within this area. Because viewers use different resolutions I have to make sure it is always centered, and the both sides are always covered by the background shape! I therefore used a shape with height: 1px and width: 1600 px

1. Open notepad and add the following css script. I will discuss it beneath.

CODE
body {  
background: #D3D3AF url(back.gif) repeat-y 50% 0;
background-attachment: fixed;
margin: 0;
padding: 0;
}

#container {
border: none;
margin: 0px;
margin-left: auto;
margin-right: auto;
width: 758px;
height: 100%;
}


background color is given, I specified the backgroundimage and entered settings so that it will only repeat vertically and it its always centered! That is very important since the swf will be placed in the middle part of the background graphic, as can be seen in the example site I posted above. Margin and padding both 0

The swf will be placed in a container. The width specifies the width of the swf, the other settings make sure it is centered.


Now for your html file:

Link to your external css by adding the following in your head tags, remember to change the link to your own .css ofcourse.

CODE
<link rel="stylesheet" href="bali.css" type="text/css">


In the body tags, place the following code with the swf code in between (in swishmax click File > Export > Copy HTML to clipboard).

CODE
<div id="container">
</div>


You are done! No additional coding is required since the css takes care of the background color and image, and centers the swf in the page
 
+Quote Post  Go to the top of the page
*D*
post Mar 4 2005, 11:02 AM
Post #2


Merry KissMoose
Group Icon
Group: Main Team
Posts: 15,990
Joined: 18-May 04
From: North Pole
Member No.: 2





Thankyou for adding will be of great use to newbies starting out.

BTW http://www.helpingbali.com/ very nice great cause.
 
+Quote Post  Go to the top of the page
Eddie_K
post Mar 4 2005, 11:33 AM
Post #3


Hush now, I'm thinking...
Group Icon
Group: *Premier*
Posts: 3,977
Joined: 25-May 04
From: Heaven
Member No.: 47





I don't quite understand what the site is about, but it rocks bigwink.gif great work Red.

Nice use of CSS.

Eddie
 
+Quote Post  Go to the top of the page
josephine
post Mar 4 2005, 11:47 AM
Post #4


*Silly dot *
Group Icon
Group: *Premier*
Posts: 725
Joined: 15-February 05
From: Gr,Athens
Member No.: 2,118





Thanks for adding this tut red!very understandable!

I haven't used css with flash,i'll start from now on :)looks kewl


Eddie: it's a website for an orphanage in Bali!
 
+Quote Post  Go to the top of the page
RedDragon
post Mar 4 2005, 03:36 PM
Post #5


insert coin
Group Icon
Group: Main Team
Posts: 5,344
Joined: 24-May 04
From: Maastricht
Member No.: 35





do you read dutch?

oh I think I explained it somewhere lol. English version in the next two weeks as promised...


Thx for the comments!
 
+Quote Post  Go to the top of the page
oliverp
post Mar 4 2005, 08:51 PM
Post #6


New Member
Group Icon
Group: Member
Posts: 9
Joined: 4-March 05
Member No.: 2,397





hey thanx! helped me a lot ;o)
 
+Quote Post  Go to the top of the page
kingivan
post Mar 5 2005, 12:04 PM
Post #7


New Member
Group Icon
Group: Member
Posts: 16
Joined: 5-March 05
From: Egypt
Member No.: 2,403





thx smile.gif u help me
 
+Quote Post  Go to the top of the page
vidoman
post Mar 5 2005, 12:28 PM
Post #8


Corel User to User Site Admin
Group Icon
Group: *Premier*
Posts: 407
Joined: 25-May 04
From: Here
Member No.: 48





yahoo[1].gif Alright Johnny!!! Excellant, and perfect timing for me, I've been trying to figure out how to do this... Many thanks.. banana.gif
 
+Quote Post  Go to the top of the page
jandebouwman
post Mar 6 2005, 03:22 AM
Post #9


Regular Dot
Group Icon
Group: *Premier*
Posts: 190
Joined: 21-May 04
Member No.: 23





very nifty red, it's much easier then the 'table-in-table-center' code, seen on motiongerm.com.

Good tut, easy to follow.

- Dennis
 
+Quote Post  Go to the top of the page
RedDragon
post Mar 6 2005, 04:03 AM
Post #10


insert coin
Group Icon
Group: Main Team
Posts: 5,344
Joined: 24-May 04
From: Maastricht
Member No.: 35





thx for the kind words guys smile.gif

QUOTE
Alright Johnny!!! Excellant, and perfect timing for me, I've been trying to figure out how to do this... Many thanks..


not a problem ron, glad to be of any help smile.gif
 
+Quote Post  Go to the top of the page

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 29th July 2010 - 11:06 PM
Washing Machines | Car Insurance Quote | Property in Cyprus | Package Holidays | Free Online Greeting Cards : Meme4u