d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Student Needs Help With Html5 Forumlas > Padding Forumla, I Forgot It.
Prev123Next
Add Reply New Topic New Poll
Member
Posts: 35,456
Joined: Jan 25 2009
Gold: 1,173.00
Feb 15 2013 01:50am
That's just a small portion of my toolBox.txt file.
Member
Posts: 14,687
Joined: Mar 7 2004
Gold: 1,833.00
Feb 15 2013 01:51am
ahh i see.
what i would call my "code snippet file". yea i have a pretty large one. :)

please pm me once you learn more about that formula I am truly curious to know what it is..

This post was edited by Ralphdp on Feb 15 2013 01:51am
Member
Posts: 35,456
Joined: Jan 25 2009
Gold: 1,173.00
Feb 15 2013 01:53am
Quote (Ralphdp @ 15 Feb 2013 02:40)
In the W3C CSS box model a block level element’s total width is calculated using the following formula:
total width = margin-left + border-left + padding-left + width + padding-right + border-right + margin-right

im just curious now cause this "formula" that your professor knows could have come in handy...


That might be it. I wish I could answer you better but it's late lol.

Quote (Ralphdp @ 15 Feb 2013 02:51)
ahh i see.
what i would call my "code snippet file". yea i have a pretty large one. :)

please pm me once you learn more about that formula I am truly curious to know what it is..


Oh indeed. I like his class because he makes everything very easy to understand. Unlike my Java teacher who is ALL OVER THE PLACE! I'm practically taking the pre-constructed java files and debugging/syntax error fixing them and turning the file in after heavy editing. haha.

This post was edited by NinjaSushi2 on Feb 15 2013 01:54am
Member
Posts: 14,687
Joined: Mar 7 2004
Gold: 1,833.00
Feb 15 2013 02:00am
haha thats awesome. when i see the professor is all over the place i just space out and focus on the code.. ull be surprised what you can figure out just by looking at it.
but its always refreshing to have a professor who has his/her shit straight.. (makes everyones life easier)

debuging java is where it starts to get interesting.. i still struggle with java and its logic.
Member
Posts: 35,456
Joined: Jan 25 2009
Gold: 1,173.00
Feb 15 2013 02:12am
Quote (Ralphdp @ 15 Feb 2013 03:00)
haha thats awesome. when i see the professor is all over the place i just space out and focus on the code.. ull be surprised what you can figure out just by looking at it.
but its always refreshing to have a professor who has his/her shit straight.. (makes everyones life easier)

debuging java is where it starts to get interesting.. i still struggle with java and its logic.


I hear that. I stared at some code I wrote today for at least three hours before realizing I declared the origin x and y axis (rather point of origin) at 300, 300 when trying to do a .fillRect. lol I wrote (GUI was paper btw) paper.fillRect (300, 300, 300, 300); It should have been (0 , 0, 300, 300); but I was not thinking. So the whole time I couldn't figure out why it wouldn't draw this square as an overlay background. Well my frame was 300x300 so it was drawing the square but it was drawing it off the JFrame. lol

This post was edited by NinjaSushi2 on Feb 15 2013 02:16am
Member
Posts: 1,628
Joined: Aug 11 2012
Gold: 628.00
Feb 15 2013 03:08am
Quote (NinjaSushi2 @ Feb 15 2013 01:48am)
Well a text file. Whether you use Notepad, word pad, Notepad++, etc. It's a file you name toolBox.txt or whatever you like and you put all you code in there. Such as all your page setup code for index pages, href links, divs, etc. Instead of typing it out you can just copy paste it and it makes writing out the pages faster and safer considering you aren't typing so you have a less chance for error; typos.

Here is the start of my toolbox. Mind you I am only a student so it's not very well developed yet but my professor has strings and strings of coding he can call on.

Edit: I always put the last time I updated it at the very top. Month.Year

Code
<!-- Updated Feb.2013 -->

<!DOCTYPE html>
<html lang="en">

<!--

documentation segment
website:
web page:
author:
date created: month.year

-->

<head>
<meta charset="utf-8">

<title>title</title>

<style type="text/css">

#wrapper
{
wdith: 950;
margin: 0 auto;
}


#master
{
position: absolute;
padding: 0 em;
border: 1px solid #000;
background-color:#fff;
wdith: 950px;
height: 1000px;
top: 10px;
left: 10px;
}

<!-- The width of the wrapper and the width of the master HAVE to be the same!! -->

</style>

</head>

<!DOCTYPE html>
<html lang="en">

<!-- This is your langauge setting. <html lang="en"> says the language is English -->

<!-- em is a size of measurement. -->


<!-- This is how do do a comment. -->

<head>
<meta charset="utf-8">

<!-- meta charset="utf-8" is telling the browser you are using a keyboard. (English) -->

<title>title</title>

<head>
</head>


Hope this helps so I can give back to the community.


Hmm cant say i do, but then again I can write html/css and most of the php i do from the top of my head. if i cant remember the exact syntax for something i usually just use google.
Member
Posts: 35,456
Joined: Jan 25 2009
Gold: 1,173.00
Feb 15 2013 11:22am
I think that might have been it.

Either way this will help, thanks!

Code
total width = margin-left + border-left + padding-left + width + padding-right + border-right + margin-right
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Feb 15 2013 04:03pm
Quote (NinjaSushi2 @ Feb 15 2013 02:39am)
Oh there is. It's a simple algebraic equation for finding out the difference you need. It's really simple but I just can't remember it! Grr!! I'll let you know Monday when I have night class. Might be in my book somewhere.
8 years is good no doubt but remember he is a college professor with a Master's Degree in this sort of field. Also he is about my dad's age so I'm guess he's in his late 50s no doubt. Probably been doing this since the internet became the internet officially around the 80ish. I'll ask.

Edit: lol yeah someone else pointed that out earlier on OCN. Duelly noted. haha


half of the width of the box - half of the width of the content will accomplish what you want
doing what i said is easier
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Feb 15 2013 04:05pm
Quote (0n35 @ Feb 15 2013 06:03pm)
half of the width of the box - half of the width of the content will accomplish what you want
doing what i said is easier


aka

(width - content)/2

hardly a formula at all lol

This post was edited by AbDuCt on Feb 15 2013 04:05pm
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Feb 15 2013 05:00pm
Quote (AbDuCt @ Feb 15 2013 05:05pm)
aka

(width - content)/2

hardly a formula at all lol


that he needs to ask his 50 year old professor for..
Go Back To Programming & Development Topic List
Prev123Next
Add Reply New Topic New Poll