jQuery: How to change the size of a css block? -
working on assignment, , don't think part we're supposed having trouble (we're supposed working on scroll buttons, have idea on):
"--create page displays paragraphs using css block style. block size should small display text in entirety."
i've got bunch of text in div id="story" , have inside script tags:
$("#story").css("display", "block");
however nothing appears change. layout remains same , can't life of me figure out how change size of css block. find box-size.
so 2 questions: 1. why display not changing when use .css() apply 'block' , 2. how specify size of css block?
edit: i've tried adding:
$("#story").css("height", "20px");
but shows no change.
edit:
thank all! spot on , feel incredibly silly. didn't realize overflow had set before apply size setting. put in:
overflow: scroll;
it started displaying correctly. guess that's trying put in 1 piece @ time
;p
.css("display", "block")
displays element block element. div displayed block default.
what have specify height manually, either through css:
#story { height: 100px; }
or if want use jquery:
$("#story").css("height", "100px");
if want have scrollable, add css:
overflow-y: scroll;
Comments
Post a Comment