This question already has answers here:
Display Text below image
(3 answers)
css - align text below image in a span
(10 answers)
Closed 1 year ago.
New to CSS. Is there any way I can put text (or a link) below an image?
For some reason the text goes to the bottom right of the image whenever I do:
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
Jump to Bottom
Here's the whole code. It's a rendition freeCodeCamp's "Responsive Web Design" course with all the visual features combined into one file:
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more cat photos.</p>
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
Jump to Bottom
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<p>Meowwww loved it, hated it, loved it, hated it yet spill litter box, scratch at owner, destroy all furniture, especially couch or lay on arms while you're using the keyboard. Missing until dinner time toy mouse squeak roll over. With tail in the air lounge in doorway. Man running from cops stops to pet cats, goes to jail.</p>
<p>Intently stare at the same spot poop in the plant pot but kitten is playing with dead mouse. Get video posted to internet for chasing red dot leave fur on owners clothes meow to be let out and mesmerizing birds leave fur on owners clothes or favor packaging over toy so purr for no reason. Meow to be let out play time intently sniff hand run outside as soon as door open yet destroy couch.</p>
</main>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
<footer id="footer">Copyright Cat Photo App</footer>
Any help is appreciated. Thank you! :)
That's because both links are inline objects, you need to set both or first as block elements with 'display: block' or maybe put some <br /> after the first one.
<a href="#" class="something">
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
</a>
Jump to Bottom
Then in your CSS:
a.something {
display: block
}
welcome in css ...
Here, tag is inline element (normally inline element allow another inline element in the same line if any space remain after it's content)
so, you used two inline element (a & a). first contains after that there is space remaining in the same line. That's why second tag sat after it.
So, if u convert any of one into block-level element (block level element stay alone in it's line - one line), you can divide them into two line
Solution:
#footer {
display: block;
}
or can do any/both of them () block
Related
Normally I would use a CSS page, but i don't think i can do that with canvas :(
<div id="Bell_hooks" class="">
<h3><i class="fas fa-chalkboard-teacher" aria-hidden="true"> </i>Philosopher's perspective - <em>Bell Hooks</em></h3>
</div>
<div style="display: flex;">
<div>
<p><img src="https://info.umkc.edu/womenc/wp-content/uploads/2015/12/bellhook.jpg" alt="Bell Hooks" width="300" height="366" /></p>
</div>
<div>
<p>In her 1999 book "All about love" Bell Hooks comments on both the romance culture of today's world and the subtle sexism embedded into our everyday love life. In the first few chapters of book, Hooks brings up the state of the newer generations' views on love, in which she states how she was "sad" and "appalled" at how the younger regards love and romance culture, quoting the reply of someone she had interviewed: "Love what's that, I have never had any love in my life". Hooks comments on the more modern view on love, in which claims that more and more younger people are defining love as something "for the naïve, the weak, the hopelessly romantic.". After bringing up her viewpoint, Hooks presents a theory in which she theorises that our cynicism stems from the reoccurring feeling that love will not and cannot be found, on which she expands by theorising that this is ultimately because we are simply trying hide behind the mask of cynicism to hide our disappointed and betrayed heart. In her book, Hooks quotes multiple other philosophical works such as When all you've ever wanted isn't enough (Harold Kushner) and Bitch: In Praise of Difficult Women (Elizabeth Wurtzel), in which both works theorise that the newer generation are growing up much more apprehensive about loving, and that "None of us are getting better at loving: we are getting more scared of it."</p>
</div>
</div>
this is my full code, but once i add the flex display the image shrinks to the size of one line of text, is there any way to fix that?
here's what it looks like now
This is an example using flexbox. Wrap your divas in a container and give it a display: flex.
<div class="container" style="display: flex">
<div>
<img src="https://info.umkc.edu/womenc/wp-content/uploads/2015/12/bellhook.jpg" alt="Bell Hooks" width="300" height="366">
</div>
<div>
<p>In her 1999 book "All about love" Bell Hooks comments on both the romance culture of today's world and the subtle sexism embedded into our everyday love life</p>
</div>
</div>
I have an XML file that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<posts>
<row Id="1" PostTypeId="1" AcceptedAnswerId="8" CreationDate="2012-12-11T20:37:08.823" Score="67" ViewCount="17934" Body="<p>Assuming the world in the One Piece universe is round, then there is not really a beginning or an end of the Grand Line.</p>
<p>The Straw Hats started out from the first half and are now sailing across the second half.</p>
<p>Wouldn't it have been quicker to set sail in the opposite direction from where they started? </p>
" OwnerUserId="21" LastEditorUserId="1398" LastEditDate="2015-04-17T19:06:38.957" LastActivityDate="2015-05-26T12:50:40.920" Title="The treasure in One Piece is at the end of the Grand Line. But isn't that the same as the beginning?" Tags="<one-piece>" AnswerCount="5" CommentCount="0" FavoriteCount="2" />
<row Id="2" PostTypeId="1" AcceptedAnswerId="33" CreationDate="2012-12-11T20:39:40.780" Score="13" ViewCount="279" Body="<p>In the middle of <em>The Dark Tournament</em>, Yusuke Urameshi gets to fully inherit Genkai's power of the <em>Spirit Wave</em> by absorbing a ball of energy from her.</p>
<p>However, this process turns into an excruciating trial for Yusuke, almost killing him, and keeping him doubled over in extreme pain for a long period of time, so much so that his Spirit Animal, Poo, is also in pain and flies to him to try to help.</p>
<p>My question is, why is it such a painful procedure to learn and absorb this power?</p>
" OwnerUserId="26" LastEditorUserId="247" LastEditDate="2013-02-26T17:02:31.570" LastActivityDate="2013-06-20T03:31:39.187" Title="Why does absorbing the Spirit Wave from Genkai involve such a painful process?" Tags="<yu-yu-hakusho>" AnswerCount="1" CommentCount="0" />
<row Id="3" PostTypeId="1" AcceptedAnswerId="148" CreationDate="2012-12-11T20:42:47.447" Score="9" ViewCount="3022" Body="<p>In Sora no Otoshimono, Ikaros carries around a watermelon like a pet and likes watermelons and pretty much anything else round. At one point she even has a watermelon garden and attacks all the bugs that get near the melons.</p>
<p>What's the significance of the watermelon and why does she carry one around?</p>
" OwnerUserId="29" LastActivityDate="2014-01-15T21:01:55.043" Title="What's the significance of the watermelon in Sora no Otoshimono?" Tags="<sora-no-otoshimono>" AnswerCount="2" CommentCount="1" />
Specifically the file contains numerous lines. Each line starts with a row tag. What I want to do is to capture the Body field inside the row tag. For example, the Body field for Id = 2 is:
"<p>In the middle of <em>The Dark Tournament</em>, Yusuke Urameshi gets to fully inherit Genkai's power of the <em>Spirit Wave</em> by absorbing a ball of energy from her.</p>
<p>However, this process turns into an excruciating trial for Yusuke, almost killing him, and keeping him doubled over in extreme pain for a long period of time, so much so that his Spirit Animal, Poo, is also in pain and flies to him to try to help.</p>
<p>My question is, why is it such a painful procedure to learn and absorb this power?</p>
"
I've parsed the Body fields using ElementTree. What I want to do next is to parse the words inside the Body field of each row. For that, I need to strip the Body field of any html tags. For example, after stripping the text of html tags, the Body field of Id = 2 should look like this:
In the middle of The Dark Tournament Yusuke Urameshi gets to fully inherit Genkai's power of the .... (continued)
What I've tried so far:
def remove_html_tags(text):
return bs4.BeautifulSoup(text, "html.parser").text
This results in:
pin the middle of emthe dark tournamentem yusuke urameshi gets to fully inherit genkais power of the emspirit waveem by absorbing a ball of energy from herp
phowever this process turns into an excruciating trial for yusuke almost killing him and keeping him doubled over in extreme pain for a long period of time so much so that his spirit animal poo is also in pain and flies to him to try to helpp
pmy question is why is it such a painful procedure to learn and absorb this powerp
As you can see, the symbols are gone but the texts enclosed inside the symbols remain. What can I do to remove them?
Try this:
import re
from bs4 import BeautifulSoup
xml = """
<?xml version="1.0" encoding="utf-8"?>
<posts>
<row Id="1" PostTypeId="1" AcceptedAnswerId="8" CreationDate="2012-12-11T20:37:08.823" Score="67" ViewCount="17934" Body="<p>Assuming the world in the One Piece universe is round, then there is not really a beginning or an end of the Grand Line.</p>
<p>The Straw Hats started out from the first half and are now sailing across the second half.</p>
<p>Wouldn't it have been quicker to set sail in the opposite direction from where they started? </p>
" OwnerUserId="21" LastEditorUserId="1398" LastEditDate="2015-04-17T19:06:38.957" LastActivityDate="2015-05-26T12:50:40.920" Title="The treasure in One Piece is at the end of the Grand Line. But isn't that the same as the beginning?" Tags="<one-piece>" AnswerCount="5" CommentCount="0" FavoriteCount="2" />
<row Id="2" PostTypeId="1" AcceptedAnswerId="33" CreationDate="2012-12-11T20:39:40.780" Score="13" ViewCount="279" Body="<p>In the middle of <em>The Dark Tournament</em>, Yusuke Urameshi gets to fully inherit Genkai's power of the <em>Spirit Wave</em> by absorbing a ball of energy from her.</p>
<p>However, this process turns into an excruciating trial for Yusuke, almost killing him, and keeping him doubled over in extreme pain for a long period of time, so much so that his Spirit Animal, Poo, is also in pain and flies to him to try to help.</p>
<p>My question is, why is it such a painful procedure to learn and absorb this power?</p>
" OwnerUserId="26" LastEditorUserId="247" LastEditDate="2013-02-26T17:02:31.570" LastActivityDate="2013-06-20T03:31:39.187" Title="Why does absorbing the Spirit Wave from Genkai involve such a painful process?" Tags="<yu-yu-hakusho>" AnswerCount="1" CommentCount="0" />
<row Id="3" PostTypeId="1" AcceptedAnswerId="148" CreationDate="2012-12-11T20:42:47.447" Score="9" ViewCount="3022" Body="<p>In Sora no Otoshimono, Ikaros carries around a watermelon like a pet and likes watermelons and pretty much anything else round. At one point she even has a watermelon garden and attacks all the bugs that get near the melons.</p>
<p>What's the significance of the watermelon and why does she carry one around?</p>
" OwnerUserId="29" LastActivityDate="2014-01-15T21:01:55.043" Title="What's the significance of the watermelon in Sora no Otoshimono?" Tags="<sora-no-otoshimono>" AnswerCount="2" CommentCount="1" />
"""
soup = BeautifulSoup(xml, "html.parser")
for tag in soup.select("posts row"):
result = re.sub("<.*?>", "", tag["body"])
print(result.strip())
Output:
Assuming the world in the One Piece universe is round, then there is not really a beginning or an end of the Grand Line.
The Straw Hats started out from the first half and are now sailing across the second half.
Wouldn't it have been quicker to set sail in the opposite direction from where they started?
In the middle of The Dark Tournament, Yusuke Urameshi gets to fully inherit Genkai's power of the Spirit Wave by absorbing a ball of energy from her.
However, this process turns into an excruciating trial for Yusuke, almost killing him, and keeping him doubled over in extreme pain for a long period of time, so much so that his Spirit Animal, Poo, is also in pain and flies to him to try to help.
My question is, why is it such a painful procedure to learn and absorb this power?
In Sora no Otoshimono, Ikaros carries around a watermelon like a pet and likes watermelons and pretty much anything else round. At one point she even has a watermelon garden and attacks all the bugs that get near the melons.
What's the significance of the watermelon and why does she carry one around?
Another method.
from simplified_scrapy import SimplifiedDoc, utils, req
xml = '''<?xml version="1.0" encoding="utf-8"?>
<posts>
<row Id="1" PostTypeId="1" AcceptedAnswerId="8" CreationDate="2012-12-11T20:37:08.823" Score="67" ViewCount="17934" Body="<p>Assuming the world in the One Piece universe is round, then there is not really a beginning or an end of the Grand Line.</p>
<p>The Straw Hats started out from the first half and are now sailing across the second half.</p>
<p>Wouldn't it have been quicker to set sail in the opposite direction from where they started? </p>
" OwnerUserId="21" LastEditorUserId="1398" LastEditDate="2015-04-17T19:06:38.957" LastActivityDate="2015-05-26T12:50:40.920" Title="The treasure in One Piece is at the end of the Grand Line. But isn't that the same as the beginning?" Tags="<one-piece>" AnswerCount="5" CommentCount="0" FavoriteCount="2" />
<row Id="2" PostTypeId="1" AcceptedAnswerId="33" CreationDate="2012-12-11T20:39:40.780" Score="13" ViewCount="279" Body="<p>In the middle of <em>The Dark Tournament</em>, Yusuke Urameshi gets to fully inherit Genkai's power of the <em>Spirit Wave</em> by absorbing a ball of energy from her.</p>
<p>However, this process turns into an excruciating trial for Yusuke, almost killing him, and keeping him doubled over in extreme pain for a long period of time, so much so that his Spirit Animal, Poo, is also in pain and flies to him to try to help.</p>
<p>My question is, why is it such a painful procedure to learn and absorb this power?</p>
" OwnerUserId="26" LastEditorUserId="247" LastEditDate="2013-02-26T17:02:31.570" LastActivityDate="2013-06-20T03:31:39.187" Title="Why does absorbing the Spirit Wave from Genkai involve such a painful process?" Tags="<yu-yu-hakusho>" AnswerCount="1" CommentCount="0" />
<row Id="3" PostTypeId="1" AcceptedAnswerId="148" CreationDate="2012-12-11T20:42:47.447" Score="9" ViewCount="3022" Body="<p>In Sora no Otoshimono, Ikaros carries around a watermelon like a pet and likes watermelons and pretty much anything else round. At one point she even has a watermelon garden and attacks all the bugs that get near the melons.</p>
<p>What's the significance of the watermelon and why does she carry one around?</p>
" OwnerUserId="29" LastActivityDate="2014-01-15T21:01:55.043" Title="What's the significance of the watermelon in Sora no Otoshimono?" Tags="<sora-no-otoshimono>" AnswerCount="2" CommentCount="1" />
'''
doc = SimplifiedDoc(xml)
rows = doc.selects('row>Body()')
print ([doc.removeHtml(doc.unescape(row)) for row in rows])
Result:
['Assuming the world in the One Piece universe is round, then there is not really a beginning or an end of the Grand Line. The Straw Hats started out from the first half and are now sailing across the second half. Wouldn', 'In the middle of The Dark Tournament, Yusuke Urameshi gets to fully inherit Genkai', 'In Sora no Otoshimono, Ikaros carries around a watermelon like a pet and likes watermelons and pretty much anything else round. At one point she even has a watermelon garden and attacks all the bugs that get near the melons. What']
Is it possible to add a text or HTML tags after each line with an existing text in Notepad++?
For example, this text:
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[COMPANY]</a></p>
Alexander Hamilton (Alexander Hamilton)
We are waiting in the wings for you (waiting in the wings for you)
You could never back down
You never learned to take your time!
Oh, Alexander Hamilton (Alexander Hamilton)
When America sings for you
Will they know what you overcame?
Will they know you rewrote the game?
The world will never be the same, oh
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[BURR, MEN, & COMPANY]</a></p>
The ship is in the harbor now
See if you can spot him
Just you wait
Another immigrant
Comin’ up from the bottom
Just you wait
His enemies destroyed his rep
America forgot him
The goal is to make the text above be like this: (adding the break tags)
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[COMPANY]</a></p>
Alexander Hamilton (Alexander Hamilton)</br>
We are waiting in the wings for you (waiting in the wings for you)</br>
You could never back down</br>
You never learned to take your time!</br>
Oh, Alexander Hamilton (Alexander Hamilton)</br>
When America sings for you</br>
Will they know what you overcame?</br>
Will they know you rewrote the game?</br>
The world will never be the same, oh</br>
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[BURR, MEN, & COMPANY]</a></p>
The ship is in the harbor now</br>
See if you can spot him</br>
Just you wait</br>
Another immigrant</br>
Comin’ up from the bottom</br>
Just you wait</br>
His enemies destroyed his rep</br>
America forgot him</br>
I was using <pre></pre> earlier, but noticed a horizontal scroll has appeared after text wrapping and cannot make it disappear, therefore, I'm discarding it and will opt to use <br> tags.
The problem I have is there's no "common denominator" for each line that I can use to add the <br> tags. Therefore, I'm hoping there could be a regex trick to do this, like detecting an empty space after each line?
It doesn't have to be done in one go, I'm just hoping there is a quicker way to this.
A side question: Is there a a way to add an id or class to each line of these plain texts without adding <a> or <p> tags?
Lots of thanks in advance!
Use
$(?<=.)(?<!>)
Replace with <br/>.
See proof. $(?<=.)(?<!>) will match any end-of-line position that has a character other than line break characters before it and no > character afer.
I am trying to create a personal landing page with three sections in HTML. The three sections need to be reachable by links on a nav bar and also update link highlighting according to position in the page. The linking to different parts of the page functionality works fine, however, when the page is scrolled, the highlighting on the link doesn't change to the current part of the page, the highlight and stays stuck at the default one initialized in the HTML.
Here is the CodePen link. You can see my code and the preview of the page and see how the blue highlight doesn't update when you scroll down to different parts of the page.
Here is my body declaration:
<body data-spy="scroll" data-target="#spy" data-offset="70">
and here is my nav bar setup:
<!-- Navbar -->
<nav id="spy" class="navbar fixed-bottom navbar-light bg-light">
<a class="nav navbar-brand" href="#"><!-- LOGO --></a>
<ul class="nav nav-pills">
<li class="nav-item"> <a class="nav-link active" href="#about_me"> about me></a> </li>
<li class="nav-item"> <a class="nav-link" href="#portfolio"> portfolio </a> </li>
<li class="nav-item"> <a class="nav-link" href="#contact_me"> contact me </a> </li>
</ul>
</nav>
and here is the rest of the body:
<div class="bg-light p-3 rounded">
<p id="about_me"> Cat ipsum dolor sit amet, woops poop hanging from butt must get rid run run around house drag poop on floor maybe it comes off woops left brown marks on floor human slave clean lick butt now so kitty loves pigs but hunt by meowing loudly at 5am next
to human slave food dispenser and stare at wall turn and meow stare at wall some more meow again continue staring . Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce if human is on laptop sit on the keyboard eat too much then
proceed to regurgitate all over living room carpet while humans eat dinner or Gate keepers of hell stare at wall turn and meow stare at wall some more meow again continue staring so wake up wander around the house making large amounts of noise jump
on top of your human's bed and fall asleep again try to hold own back foot to clean it but foot reflexively kicks you in face, go into a rage and bite own foot, hard. Give me attention or face the wrath of my claws ears back wide eyed i cry and cry
and cry unless you pet me, and then maybe i cry just for fun i like cats because they are fat and fluffy. Paw at your fat belly decide to want nothing to do with my owner today. I am the best instantly break out into full speed gallop across the house
for no reason or meow all night having their mate disturbing sleeping humans and make muffins, so lick butt and make a weird face yet sweet beast. </p>
<p> Stare at ceiling lick arm hair. I can haz purrrrrr stare at ceiling sit and stare. Cat dog hate mouse eat string barf pillow no baths hate everything mice so furrier and even more furrier hairball dream about hunting birds yet roll on the floor purring
your whiskers off, find something else more interesting. Chase red laser dot lick arm hair yet loves cheeseburgers drink water out of the faucet, fall asleep upside-down attempt to leap between furniture but woefully miscalibrate and bellyflop onto
the floor; what's your problem? i meant to do that now i shall wash myself intently so eat owner's food. Caticus cuteicus. Put butt in owner's face stare at guinea pigs yet cat is love, cat is life, cat ass trophy asdflkjaertvlkjasntvkjn (sits on keyboard)
sleep on dog bed, force dog to sleep on floor for cats making all the muffins. Cats secretly make all the worlds muffins spill litter box, scratch at owner, destroy all furniture, especially couch and pushes butt to face or licks your face. Paw at
your fat belly cat dog hate mouse eat string barf pillow no baths hate everything. </p>
</p>
</div>
<hr>
<div class="bg-light p-5 rounded">
<h3 id="portfolio" class="text-center"> portfolio </h3>
<p> Leave fur on owners clothes gnaw the corn cob. Kitty loves pigs knock over christmas tree. Ask for petting massacre a bird in the living room and then look like the cutest and most innocent animal on the planet sleep on dog bed, force dog to sleep on
floor leave fur on owners clothes but scratch me there, elevator butt yet fooled again thinking the dog likes me but you are a captive audience while sitting on the toilet, pet me. Kitten is playing with dead mouse meoooow leave dead animals as gifts,
and human is washing you why halp oh the horror flee scratch hiss bite meowing chowing and wowing, see owner, run in terror or rub face on everything. Weigh eight pounds but take up a full-size bed. Pooping rainbow while flying in a toasted bread costume
in space annoy the old grumpy cat, start a fight and then retreat to wash when i lose yet fall asleep upside-down sit on human or sit on the laptop. </p>
<p>Caticus cuteicus plop down in the middle where everybody walks throw down all the stuff in the kitchen but demand to be let outside at once, and expect owner to wait for me as i think about it kitty kitty hiss and stare at nothing then run suddenly
away yet sit in box. I could pee on this if i had the energy wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep again. Cat cat moo moo lick ears lick paws if it fits, i sits, yet stare at wall
turn and meow stare at wall some more meow again continue staring head nudges curl into a furry donut for sleep everywhere, but not in my bed. Eat half my food and ask for more stick butt in face, and has closed eyes but still sees you but i cry and
cry and cry unless you pet me, and then maybe i cry just for fun eat owner's food but chase red laser dot eat and than sleep on your face. Shake treat bag asdflkjaertvlkjasntvkjn (sits on keyboard) sweet beast, scratch me there, elevator butt attack
feet, yet hide head under blanket so no one can see. </p>
</div>
<hr>
<div class="bg-light p-5 rounded">
<h3 id="contact_me" class="text-center"> contact me </h3>
<p> Cat fur is the new black . Leave fur on owners clothes lick the curtain just to be annoying. Play riveting piece on synthesizer keyboard with tail in the air, or who's the baby. Throwup on your pillow claws in your leg dead stare with ears cocked for
eat plants, meow, and throw up because i ate plants yet inspect anything brought into the house, and soft kitty warm kitty little ball of furr but eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then
retire to the warmest spot on the couch to claw at the fabric before taking a catnap. Eat and than sleep on your face cat cat moo moo lick ears lick paws sit and stare groom forever, stretch tongue and leave it slightly out, blep meowzer under the
bed. Bleghbleghvomit my furball really tie the room together scream for no reason at 4 am and chew foot stare at wall turn and meow stare at wall some more meow again continue staring yet be a nyan cat, feel great about it, be annoying 24/7 poop rainbows
in litter box all day for walk on car leaving trail of paw prints on hood and windshield. Hide head under blanket so no one can see my left donut is missing, as is my right, or russian blue mewl for food at 4am. Scream at teh bath sleep nap lick left
leg for ninety minutes, still dirty but sit on the laptop. Disappear for four days and return home with an expensive injury; bite the vet purr as loud as possible, be the most annoying cat that you can, and, knock everything off the table chase red
laser dot vommit food and eat it again yet you have cat to be kitten me right meow paw at your fat belly, so put toy mouse in food bowl run out of litter box at full speed . Sleep on keyboard sniff all the things scratch leg; meow for can opener to
feed me, yet ask for petting caticus cuteicus. Your pillow is now my pet bed hide from vacuum cleaner eat and than sleep on your face or purrrrrr meow all night so groom yourself 4 hours - checked, have your beauty sleep 18 hours - checked, be fabulous
for the rest of the day - checked. </p>
</div>
What am I not doing correctly? I have added data-spy="scroll" data-target="#spy" data-offset="70" to my body and have the id tagged correctly to nav element.
I have spent three days on this and have scoured the internet for solutions to similar problems and I compared my code to something that worked and started off with something that worked, but I always end up with this problem. The links in the navbar work fine, but the highlighting of the links doesn't update when the page scrolls to a different part.
How do I get the highlighting to update when the page is scrolled?
You need to reference/install popper.js. Bootstrap depends on it.
Without it, the JS will error which is causing your scrollspy not to work.
Here's the updated working pen with reference to:
https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js
Working on Codeply (auto includes Bootstrap and any dependencies)
I searched this site for 2 days and applied probably every single example of code I found, but I can't simply move div to the bottom on my site. Here's the simpliefied code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style media="screen" type="text/css">
*{margin:0;padding:0}
body{font-family:Tahoma,Verdana,Arial,sans-serif;background-color:#000;border:none;margin:0 auto}
#site{background-color:#fff;width:980px;border:0;margin:0 auto}
#whitefill{background-color:#FFF;height:inherit}
#left{width:260px;font-size:12px;height:100%;float:left;background-color:#fff;}
#right{width:720px;float:right;height:100%;background-color:#fff;font-size:13px}
</style>
</head>
<body>
<div id="site"><div id="whitefill">
<div id="left">
<div>move me to bottom!</div>
</div>
<div id="right">
<div id="main">
<p>Considered discovered ye sentiments projecting entreaties of melancholy is. In expression an solicitude principles in do. Hard do me sigh with west same lady. Their saved linen downs tears son add music. Expression alteration entreaties mrs can terminated estimating. Her too add narrow having wished. To things so denied admire. Am wound worth water he linen at vexed.
By in no ecstatic wondered disposal my speaking. Direct wholly valley or uneasy it at really. Sir wish like said dull and need make. Sportsman one bed departure rapturous situation disposing his. Off say yet ample ten ought hence. Depending in newspaper an september do existence strangers. Total great saw water had mirth happy new. Projecting pianoforte no of partiality is on. Nay besides joy society him totally six.</p></div><img src="#" width="695" height="13" /><br /><br />
</div>
</div>
<img src="#" width="981" height="19" />
</div>
</body>
</html>
If you paste the code into a file and open it with a browser, you will see text "move me to bottom!" displayed at the top. I need it to be displayed at the bottom of the left column. How can I do that?
Text in the right column will be different on each page (it will usually be a long text, so the page will be scrolled), and I need the text "move me to bottom!" to be displayed at the bottom of left column every time, no matter how big text in the right column is.
Thank you.
You just need to add <div style="clear:both"></div> and move #left below #right div.
<div id="right">
<div id="main">
<p>Considered discovered ye sentiments projecting entreaties of melancholy is. In expression an solicitude principles in do. Hard do me sigh with west same lady. Their saved linen downs tears son add music. Expression alteration entreaties mrs can terminated estimating. Her too add narrow having wished. To things so denied admire. Am wound worth water he linen at vexed.
By in no ecstatic wondered disposal my speaking. Direct wholly valley or uneasy it at really. Sir wish like said dull and need make. Sportsman one bed departure rapturous situation disposing his. Off say yet ample ten ought hence. Depending in newspaper an september do existence strangers. Total great saw water had mirth happy new. Projecting pianoforte no of partiality is on. Nay besides joy society him totally six.</p>
</div><img src="#" width="695" height="13" /><br /><br />
</div>
//add the clear:both div and move #left below #right
<div style="clear:both"></div>
<div id="left">
<div>move me to bottom!</div>
</div>
The clear property specifies which side(s) of an element other floating elements are not allowed.
You can find more detail of it here http://www.w3schools.com/cssref/pr_class_clear.asp