Scrollbar customization - html

I've the below HTML Code.
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="chat-box-new-div">
<div class="chat-box-new-head">Frequently Asked Questions ..
</div>
<div class="panel-body chat-box-new">
<ul class="questionsUl">
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
<li>Who is a public official? </li>
<li>My client asked if her son can intern with the company as a favor to her, that isn't a problem is it? </li>
<li>My friend works for the client, does that mean I can't give her a gift? </li>
<li>Is there certain criteria for gifts and entertainment </li>
<li>How do I know if Gift or Entertainment is permissible? </li>
<li>can I give gift cards to my team? </li>
<li>Do I need approval to give a gift? </li>
<li>Are Facilitating Payments” to Public Officials allowed? </li>
<li>is there approval needed for gifts to public officials? </li>
</ul>
</div>
</div>
</div>
Here Basically, I've a parent and 2 child divs. and inside the second child div, there is some content and this is not limited, more the content, we should get a scroll bar to scroll (This is working fine currently).
I'm using overflow to get the scrollbar, but the issue is like this,
If I take the scroll bar on the parent div, the scroll is working till the end.
When I take the same in the child div, it is not scrolling the entire content.
But I want the scroll in the second div(the child div) and display the entire data.
here is a working fiddle.
https://jsfiddle.net/a1zhffka/
please let me know how can I fix this.
Thanks

Something like this? https://jsfiddle.net/a1zhffka/2/
You need to add the overflow to chat-box-new. From your question it sounds like you already tried this, but your main issue was the height. The height of the div should be the height of the container, minus the height of the header. By having too tall of a height, the content will be cut-off.
For this specific example, 461px seems like the sweet spot.
.chat-box-new {
overflow-y: scroll;
height: 461px;
}
And remove the scroll from the parent:
.chat-box-new-div {
height: 502px;
border: 2px solid #157DEC;
border-bottom: 2px solid #157DEC;
overflow: hidden;
}
For future consideration, you can avoid hard-coding all the heights if you give your header a fixed-height of say 50px, and then use height: calc(100% - 50px);

Related

I need to mix a numbered list with a bulleted list, validator says this is wrong

As the subject says, I wrote this code to mix numbered list with bulleted list, it worked perfectly exactly the way I wanted it too but the validator says this is a no no so what's the proper way to do this? Below is my code:
<ol>
<li>Public, private & religious schools programs and assemblies</li>
<ul>
<li>School assembly in elementary, middle, junior high, and high schools</li>
<li>presentation to individual classes as part of the social studies or history curriculum at all grade levels</li>
<li>Present video clips on various related topics followed by class/group discussions and activities.</li>
<li>Work with youth groups/boy scouts/girl guides/YWCA</li>
<li>After school programs</li>
<li>Work with school-age after school programs</li>
<li>Work with early childhood programs</li>
<li>Community programs & activities
</ul>
<li>Topics to include but not limited to -</li>
<ul>
<li>Prejudice</li>
<li>Stereotyping</li>
<li>Implicit bias</li>
<li>Discrimination</li>
etc...
Place the ul within the li no the ol:
<ol>
<li>Public, private & religious schools programs and assemblies
<ul>
<li>School assembly in elementary, middle, junior high, and high schools</li>
<li>presentation to individual classes as part of the social studies or history curriculum at all grade levels</li>
<li>Present video clips on various related topics followed by class/group discussions and activities.</li>
<li>Work with youth groups/boy scouts/girl guides/YWCA</li>
<li>After school programs</li>
<li>Work with school-age after school programs</li>
<li>Work with early childhood programs</li>
<li>Community programs & activities
</ul>
</li>
<li>Topics to include but not limited to -
<ul>
<li>Prejudice</li>
<li>Stereotyping</li>
<li>Implicit bias</li>
<li>Discrimination</li>
</ul>
</li>
</ol>

Codecademy: Nested Lists

I'm doing a lesson on Codecademy about nested lists in html.
My code is as follows:
<ul>
<li>Work? I am currently unemployed.
Here's a list of things that I have
done though:
<ol>
<li>Farm Hand</li>
<li>Excersize Rider</li>
<li>Curator's Assistant</li>
<li>Teaching Assistant</li>
<li>Telephone Operator</li>
</ol>
</li>
<li>Education? I have dropped out of the
following institutions:
<ol>
<li>
Highschool (I did complete all
courses and receive credit)
</li>
<li>
College (I withdrew for
medical reasons)
</li>
</ol>
</li>
<li>Interests? Here are a select few:
<ol>
<li>Running</li>
<li>Martial arts</li>
<li>Equestrian activities</li>
<li>Video games</li>
</ol>
</li>
<li>Favorite Quotes
<ol>
<li>"This was a triumph"</li>
<li>
"It's not safe to go alone,
here, take this!"
</li>
<li>
"Our princess is in
another castle!"
</li>
</ol>
</li>
</ul>
However, the lesson throws the following error when I try to submit this code:
Oops, try again. Make sure you have at least one unordered list inside your unordered list of profile sections!
What am I doing wrong?
According to the error,
Oops, try again. Make sure you have at least one unordered list inside your unordered list of profile sections!
you need one unordered list inside your unordered list of profile sections. Currently, all of your internal lists are ordered lists (<ol>). Try turning one of them into a <ul>.
For example, this should match your error desciption:
<ul>
<li>Work? I am currently unemployed.
Here's a list of things that I have
done though:
<ul> <!--(Unordered List!)-->
<li>Farm Hand</li>
<li>Excersize Rider</li>
<li>Curator's Assistant</li>
<li>Teaching Assistant</li>
<li>Telephone Operator</li>
</ul>
</li>
<li>Education? I have dropped out of the
following institutions:
<ol>
<li>
Highschool (I did complete all
courses and receive credit)
</li>
<li>
College (I withdrew for
medical reasons)
</li>
</ol>
</li>
<li>Interests? Here are a select few:
<ol>
<li>Running</li>
<li>Martial arts</li>
<li>Equestrian activities</li>
<li>Video games</li>
</ol>
</li>
<li>Favorite Quotes
<ol>
<li>"This was a triumph"</li>
<li>
"It's not safe to go alone,
here, take this!"
</li>
<li>
"Our princess is in
another castle!"
</li>
</ol>
</li>
</ul>

Drop down menu linking issue with nested lists

I'm having issues with the drop down menu I created and linking to specific pages.
The issue I have is I cannot follow links to different pages as it tries to direct the browser to a file within the directory that doesn't exist. For example. When I am on the homepage and I drop down the ABOUT menu and hit OUR TEAM, it will direct to the OUR TEAM page, but once I am on the OUR TEAM page and drop down the RESOURCES menu, it tries to take me to "about/resources/whateverpage.php" as opposed to "/resources/whateverpage.php"
How do I make it so it will actually direct the to /resources directory instead of remaining within the /about directory. I've tried using "../" before the links but you can guess where the problems would arise with that.
As well, because of the fact that I have the links pointed to about/ourteam.php (for example), when I am in the ABOUT menu/directory and I go to click another page within the ABOUT menu it tries to lead me to about/about/hours.php instead of about/hours.php
Thanks folks.
My code is as follows:
<div id="menu">
<ul><strong>
<li>HOME |</li>
<li>ABOUT |
<ul>
<li>Our Team</li>
<li>Referral Process </li>
<li>Financial Policy</li>
<li>Facility</li>
<li>Hours/Directions</li>
</ul>
</li>
<li>EMERGENCY SERVICE |
<ul>
<li>What We Do</li>
<li>How We Are Staffed</li>
<li>Emergency/Referral Procedure</li>
<li>Types of Emergencies</li>
<li>What to Expect On Arrival</li>
</ul>
</li>
<li>SPECIALTY SERVICE |
<ul>
<li>Critical Care</li>
<li>Internal Medicine</li>
<li>Surgery</li>
<li>Rehab<li>
</ul>
</li>
<li>RESOURCES |
<ul>
<li>Referral Forms</li>
<li>Brochure/Business Card Reorder</li>
<li>Emergency Topics</li>
<li>Critical Care Topics</li>
<li>Internal Medicine Topics</li>
<li>Surgery Topics</li>
<li>Rehab & Fitness Topics</li>
<li>Links</li>
<li>Directions/Map</li>
<li>Where to Stay</li>
<li>Newsletter</li>
</ul>
</li>
<li>COMMUNITY EVENTS |</li>
<li>CAREERS |
<ul>
<li>Surgery</li>
<li>Neurosurgery</li>
<li>Orthopaedic</li>
</ul>
</li>
<li>CONTACT</li>
</strong></ul>
You need to add a / to the front of your links. These are relative links.

2 line li menu items

My code is as follows :
<ul>
<li> Custom Decor</li>
<li> Home Exterior </li>
<li> Cleaning Services </li>
<li> Heating & Cooling </li>
<li> Parts, Repair & Maintanence </li>
<li> Energy Effeciency </li>
<li> Sears Telecom </li>
<li> Protection Agreements </li>
</ul>
What I have is --
What I want is --
-Decor below Custom
-Exterior under Home
-Services under Cleaning , etc.
Something like this
two lines, 2 words .. How do I do this in CSS?
I can suggest you two solutions (second recomended):
Insert <br /> into your text, where new line should be inserted, or
Specify in CSS width of your item, and put between the words which should appear in one line.

Header <h2> floating to be below the next UL list

I have a multiple unordered lists, with a h2 titling each list by subject.
Here is the html
<h2>Early Childhood Education</h2>
<ul class="course-list">
<li>Child Growth and Development</li>
<li>Curriculum and Methods in Teaching Early Childhood Education</li>
<li>Introduction to Early Childhood Education</li>
<li>Introduction to Education</li>
<li>Practicum I: Early Childhood</li>
<li>Practicum II: Early Childhood</li>
<li>Practicum in Education</li>
</ul>
<h2>Emergency Medical Technician</h2>
<ul class="course-list">
<li>Emergency Medical Technician (EMT) – Basic</li>
<li>Emergency Medical Technician (EMT) – Paramedic I</li>
<li>Emergency Medical Technician (EMT) – Paramedic II (Field Internship – Part I)</li>
<li>Emergency Medical Technician (EMT) – Paramedic III</li>
<li>Emergency Medical Technician (EMT) – Paramedic IV (Field Internship – Part II)</li>
<li>EMT-Basic Fieldwork</li>
<li>Report Writing for Healthcare Professionals</li>
</ul>
<h2>English</h2>
<ul class="course-list">
<li>African American Literature</li>
<li>Basic Acting Technique</li>
<li>Contemporary American Poetry</li>
<li>English I: College Writing</li>
<li>English II: Introduction to Literature</li>
<li>Essentials of English *</li>
<li>Interpersonal Communication</li>
<li>Interviewing Practices and Principles</li>
<li>Introduction to Drama Study</li>
<li>Introduction to Poetry</li>
<li>Introduction to Technical Writing</li>
<li>Journalism</li>
<li>Journalism II</li>
<li>Literature for Children</li>
<li>Literature of the Western World</li>
<li>Major American Writers</li>
<li>Major English Writers</li>
<li>Modern American Novel</li>
<li>Nonfiction Literature</li>
<li>Public Speaking</li>
<li>Science Fiction</li>
<li>Service Learning – Volunteer Project</li>
<li>Shakespeare</li>
<li>Storytelling</li>
<li>The Short Story</li>
<li>Voice and Diction</li>
<li>Western Mythology</li>
<li>Women in Literature</li>
<li>Writing Workshop I</li>
</ul>
Here is the CSS
.col-middle .course-list li {
width:50%;
float:left;
}
Here is a screen shot of what it looks like: http://i40.tinypic.com/2141nd3.png
The problem you see in the screen shot is the text within the h2 tags is floating up a line if there is some space after the list above it.
I fixed that by setting overflow:auto; within the ul style, but that made the left half of the list discs dissapear (as you see here: http://i39.tinypic.com/2i8y62r.png)
Also, I'd like to create some spacing between the bottom of the ul list, and the h2 header.
You might wrap each h2/ul pair in a div. This is even good for semantics, since the two are related and therefore could be said to be part of a logical division. Then you can float the whole div and keep the elements grouped.
Please try this tutorial for multi column lists
By the way, floats are evil. ;)
Are the h2 tags supposed to be above each unordered list?
Perhaps what you should do is add a clear:both to the h2 definition...
h2 { clear: both; }