{"id":4048,"date":"2014-05-10T02:00:37","date_gmt":"2014-05-10T07:00:37","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=4048"},"modified":"2014-05-10T02:00:37","modified_gmt":"2014-05-10T07:00:37","slug":"css-for-long-division-applet","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/css-for-long-division-applet\/","title":{"rendered":"CSS for long division applet"},"content":{"rendered":"<p>At one time, I avoided learning CSS because it seemed like that was a &#8220;woman thing&#8221; and in my career, I have noted that if you are in a primarily female field you get paid less money and people give you more shit than in predominantly female fields &#8211; thus, construction workers make more than administrative assistants, computer programmers make more than nurses. Of course there are other differences all the way down the line, but it is a strong enough relationship that when it seemed to me that women were doing more CSS and HTML, I tended to shy away from that as &#8220;not real programming&#8221;.<\/p>\n<p>Well, that was stupid.<\/p>\n<p>CSS is now my friend and has made many things in my life easy. For a simple example, let&#8217;s look <a href=\"http:\/\/www.7generationgames.com\/spiritlake\/extras\/longdivide.html\">at the long division applet I was posting about earlier<\/a> before I went off on a tangent. The point of this is to allow students to practice long division, not to test them.<\/p>\n<p>The CSS here is in two parts. \u00a0First, there is an external style sheet<\/p>\n<p>&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; href=&#8221;lakestyle.css&#8221; \/&gt;<\/p>\n<p>this defines some classes that are the same throughout the game. Then, I have a small style section in the page that is just those styles specific to this page.<\/p>\n<p>However, to make this more generalizable, I have copied all of the classes used into the style specified below so if anyone likes, they can take the two previous posts on the javascript, this one and the next one on HTML and make their own long division program. I hate when I read something and they have left out parts that are required for it to work. That&#8217;s so annoying.<\/p>\n<p>The first part sets the container size. We do this in all of our pages so they look the same on every laptop or desktop regardless of screen size. I also have that orange background image because The Invisible Developer said it should have a background and <a href=\"http:\/\/speckyboy.com\/\">this site, speckyboy, which often gives away really free graphics,<\/a> was giving away textures that week.<\/p>\n<p>Yes, I used tables (don&#8217;t judge me!). Although I don&#8217;t always use them, I am not one of those people who believes in doing backflips with CSS, javascript and HTML to avoid tabes.<\/p>\n<p>The table will have one cell for the one-digit divisor and another\u00a0for the three-digit dividend. (This matches a common core math standard for fourth-grade &#8220;<span style=\"color: #202020;\"><em>Find whole-number quotients and remainders with up to four-digit dividends and one-digit divisors, using strategies based on place value, the properties of operations, and\/or the relationship between multiplication and division&#8221;<\/em>.)<\/span><\/p>\n<p>I want the\u00a0width of each table cell set at 25%. I want the font size to be xx-large so the problem\u00a0stands out on the page.<\/p>\n<p>The q class defines a border at the bottom an element, in this case, a table cell. \u00a0That is what gives us the top of the division problem &#8220;tableau&#8221;. I could have made it an ID but I didn&#8217;t because I thought I might add it into the external style sheet eventually and use it in other pages.<\/p>\n<p>The d class is for those cells that will show up sequentially as we solve the division problem. If you read the previous posts on the javascript for this, you&#8217;d see that as each digit of the quotient is found, we multiply it by the divisor and put the product under the dividend. It&#8217;s usual to show a line under that and subtract. So, the d class is underlined. However, when we start, those cells are empty and it would look kind of dumb having just lines there, so, when we start, the cells are hidden and they are filled in and shown, complete with underline, as we solve each step in the division problem.<\/p>\n<p>The c id is a cell where the divisor is. It has a line on the right side to make the other part of the thingy that goes around a division problem. I also want the divisor right up to the side of the cell so it looks like a regular division problem.<\/p>\n<p>The w class has a white background, so you can see the problem.<\/p>\n<p>The hidden class is for all of the elements we want hidden when the page originally loads. This includes the input form for the second digit in the quotient. We want to force the student to find the first digit, multiply that out and then find the next digit.<\/p>\n<p>And, that&#8217;s all there is to the CSS for the long-division examples.<\/p>\n<p>Next post, I&#8217;ll finish off with the HTML<\/p>\n<p>&lt;style&gt;<br \/>\n#container {<\/p>\n<p>height: 670px;<br \/>\nwidth: 1000px;<\/p>\n<p>background-image: url(orangbg.png);<br \/>\nbackground-repeat: no-repeat;<\/p>\n<p>}<br \/>\ntd {<br \/>\nwidth: 25%;<br \/>\nfont-size: xx-large;<br \/>\n}<br \/>\n.q {border-bottom: 7px solid #804040;}<br \/>\n.d{<br \/>\ndisplay: none ;<br \/>\ntext-decoration: underline ;<br \/>\n}<br \/>\n#c {<br \/>\ntext-align: right;<br \/>\nborder-right: 7px solid #804040;<br \/>\n}<br \/>\n.w{ background-color: white;}<\/p>\n<p>.hidden { display: none }<\/p>\n<p>&lt;\/style&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At one time, I avoided learning CSS because it seemed like that was a &#8220;woman thing&#8221; and in my career, I have noted that if you are in a primarily female field you get paid less money and people give you more shit than in predominantly female fields &#8211; thus, construction workers make more than&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4048","post","type-post","status-publish","format-standard","hentry","category-dr-de-mars-general-life-ramblings"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=4048"}],"version-history":[{"count":1,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4048\/revisions"}],"predecessor-version":[{"id":4049,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/4048\/revisions\/4049"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=4048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=4048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=4048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}