For a website I have to display a div with multiple spans inside. Each one contains one character (with a specific colour class). When I use wraps of any kind, they don't recognize the text as whole and wrap on whitespace but rather on single characters (since it is for the computer only one input, that just fits this place)
See image:
It should wrap at "Dieses Maß wird in [WRAP] Zoll angegeben.
.colouredAnswer {
display: flex;
flex-wrap: wrap;
}
.green {
color: #008000;
white-space: pre-wrap;
font-size: 1.5em;
line-height: 1em;
}
<div class="colouredAnswer">
<span class="yellow-green">D</span>
<span class="green">i</span>
<span class="green">e</span>
<span class="yellow">s</span>
<span class="yellow-green">e</span>
<span class="yellow-green">s</span>
<span class="green"> </span>
<span class="green">M</span>
<span class="green">a</span>
<span class="green">ß</span>
<span class="green"> </span>
<span class="green">w</span>
<span class="green">i</span>
<span class="green">r</span>
<span class="yellow-green">d</span>
<span class="green"> </span>
<span class="green">i</span>
<span class="yellow-green">n</span>
<span class="green"> </span>
<span class="green">Z</span>
<span class="yellow-green">o</span>
<span class="green">l</span>
<span class="green">l</span>
<span class="green"> </span>
<span class="green">a</span>
<span class="green">n</span>
<span class="green">g</span>
<span class="green">e</span>
<span class="green">g</span>
<span class="green">e</span>
<span class="green">b</span>
<span class="green">e</span>
<span class="green">n</span>
<span class="green">.</span>
</div>
Try wrapping each word in a div:
.colouredAnswer {
display: flex;
flex-wrap: wrap;
}
.green {
color: #008000;
white-space: pre-wrap;
font-size: 1.5em;
line-height: 1em;
}
<div class="colouredAnswer">
<div>
<span class="yellow-green">D</span>
<span class="green">i</span>
<span class="green">e</span>
<span class="yellow">s</span>
<span class="yellow-green">e</span>
<span class="yellow-green">s</span>
</div>
<span class="green"> </span>
<div>
<span class="green">M</span>
<span class="green">a</span>
<span class="green">ß</span>
</div>
<span class="green"> </span>
<div>
<span class="green">w</span>
<span class="green">i</span>
<span class="green">r</span>
<span class="yellow-green">d</span></div>
<span class="green"> </span>
<div>
<span class="green">i</span>
<span class="yellow-green">n</span>
</div>
<span class="green"> </span>
<div>
<span class="green">Z</span>
<span class="yellow-green">o</span>
<span class="green">l</span>
<span class="green">l</span></div>
<span class="green"> </span>
<div>
<span class="green">a</span>
<span class="green">n</span>
<span class="green">g</span>
<span class="green">e</span>
<span class="green">g</span>
<span class="green">e</span>
<span class="green">b</span>
<span class="green">e</span>
<span class="green">n</span>
</div>
<span class="green">.</span>
</div>
Related
In the following code, I have arranged a few divs to align horizontally. I want to create 3 rows and in each row, I want divs to move horizontally to the left at varying speeds.
Check this giphy for visual reference : http://www.giphy.com/gifs/ME8Av6LT9hgymDnqSP
.roundeddivs {
background: white;
white-space: nowrap;
padding: 20px 25px;
border-radius: 44px;
max-height: "1px";
width: auto;
margin: 8px;
font-size: 18px;
font-weight: 500;
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px,
rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
}
.block {
padding: 6rem 2rem;
}
.arrangeflex {
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
margin: 0 25px;
}
<section>
<div class="block ">
<div class="arrangeflex">
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
</div>
</section>
Animated like this (animated GIF):
If you can add copies of the elements to your HTML you can do the rest in CSS.
Each row is treated independently and has at least two copies of the items in that row - put in more (doubling up) if you think the items wont stretch across the full width of the containing block on some devices.
A row moves 50% of its total width to the left, then starts again. This means the action looks smooth as the second half of the row is "overwritten by" the first half when it hits the left hand side of its container.
This snippet uses a CSS variable --t to set the timing, and each of the rows can set its own --t.
Just a couple of rows shown in this snippet to give the idea. Add more as required, each within its own parent div. I've put 4 copies of the items in each row - probably overkill, it depends on your content and what devices you are trying to style for.
.roundeddivs {
background: white;
white-space: nowrap;
padding: 20px 25px;
border-radius: 44px;
max-height: "1px";
width: auto;
margin: 8px;
font-size: 18px;
font-weight: 500;
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
}
.block {
padding: 6rem 2rem;
width: 50vw;
}
.marquees {
margin: 0 25px;
white-space: nowrap;
overflow: hidden;
}
.marquees>* {
white-space: nowrap;
display: flex;
width: fit-content;
animation: move var(--d) linear infinite;
}
.marquees>*:nth-child(1) {
--d: 9s;
}
.marquees>*:nth-child(2) {
--d: 15s;
}
.marquees>*:nth-child(3) {
--d: 8s;
}
.marquees>*:nth-child(4) {
--d: 15ss;
}
#keyframes move {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}
<section>
<div class="block ">
<div class="marquees">
<div>
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
</div>
<div>
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
</div>
</div>
</div>
</section>
Obviously you will want to play with the timings to get the effect you need.
The easiest way I can think of is to use a marquee tag , however the element wont show up from the right directly .
.marquee{
width: 100%
}
<section>
<div class="block ">
<div class="arrangeflex">
<marquee scrollamount="6">
<span class="roundeddivs">Hello 1</span>
<span class="roundeddivs">Hello 2</span>
<span class="roundeddivs">Hello 3</span>
<span class="roundeddivs">Hello 4</span>
</marquee>
<marquee scrollamount="5">
<span class="roundeddivs">Hello 5</span>
<span class="roundeddivs">Hello 6</span>
<span class="roundeddivs">Hello 7</span>
<span class="roundeddivs">Hello 8</span>
</marquee>
<marquee scrollamount="10">
<span class="roundeddivs">Hello 9</span>
<span class="roundeddivs">Hello 10</span>
<span class="roundeddivs">Hello 11</span>
<span class="roundeddivs">Hello 12</span>
</marquee>
<marquee scrollamount="8">
<span class="roundeddivs">Hello 13</span>
<span class="roundeddivs">Hello 14</span>
<span class="roundeddivs">Hello 15</span>
<span class="roundeddivs">Hello 16</span>
<span class="roundeddivs">Hello 17</span>
</marquee>
</div>
</div>
</section>
Given an HTML template with the following structure:
<div id="user-a">
<span class="entry-1"></span>
<span class="entry-2"></span>
<span class="entry-3"></span>
<span class="entry-4"></span>
<span class="entry-5"></span>
<span class="entry-6"></span>
</div>
<div id="user-b">
<span class="entry-1"></span>
<span class="entry-2"></span>
<span class="entry-3"></span>
<span class="entry-4"></span>
<span class="entry-5"></span>
<span class="entry-6"></span>
</div>
<div id="user-c">
<span class="entry-1"></span>
<span class="entry-2"></span>
<span class="entry-3"></span>
<span class="entry-4"></span>
<span class="entry-5"></span>
<span class="entry-6"></span>
</div>
etc, is there any way to generate the child < span > elements in HTML without manually adding them for each user? I will not have access to Javascript or PHP in this environment, only a basic HTML form and an inline style sheet.
Let's say I have a text and every letter is a span with display: inline-block;:
<div>
<span class="item">A</span>
<span class="item">A</span>
<span class="item">A</span>
<span class="item"> </span>
<span class="item">A</span>
<span class="item">B</span>
<span class="item">C</span>
<span class="item"> </span>
<span class="item">A</span>
<span class="item">B</span>
<span class="item">C</span>
<span class="item">D</span>
<span class="item">E</span>
<span class="item">F</span>
<span class="item"> </span>
<span class="item">A</span>
<span class="item">B</span>
</div>
.item {
display: inline-block;
font-size: 70px;
}
By default, if the screen is viewport is smaller it will break on any letter. I would like to break on spaces, but without removing the inline-block as I need it for something else
Here is a solution with the text inside div elements and the following CSS added:
#wrapper {
display: flex;
flex-wrap: wrap;
}
.text-wrapper {
display: flex;
}
Demo:
#wrapper {
display: flex;
flex-wrap: wrap;
}
.text-wrapper {
display: flex;
}
.item {
display: inline-block;
font-size: 70px;
}
<div id="wrapper">
<div class="text-wrapper">
<span class="item">A</span>
<span class="item">A</span>
<span class="item">A</span>
<span class="item"> </span>
</div>
<div class="text-wrapper">
<span class="item">A</span>
<span class="item">B</span>
<span class="item">C</span>
<span class="item"> </span>
</div>
<div class="text-wrapper">
<span class="item">A</span>
<span class="item">B</span>
<span class="item">C</span>
<span class="item">D</span>
<span class="item">E</span>
<span class="item">F</span>
<span class="item"> </span>
</div>
<div class="text-wrapper">
<span class="item">A</span>
<span class="item">B</span>
</div>
</div>
I have tried a lot things but not able to get desired format.
HTML:
<div class="usertype">
<div class="type1">
<span class="type-heading">type1 is here</span>
<span class="type-description">10 types have joined</span>
<span class="type-description">35 type will.</span>
</div>
<div class="type2">
<span class="type-heading">type2 is here</span>
<span class="type-description">10 types are there</span>
<span class="type-description">35 type will.</span>
</div>
<div class="type1">
<span class="type-heading">type23 is good</span>
<span class="type-description">50 types are there</span>
<span class="type-description">50 types are there</span>
<span class="type-description">for 2 months</span>
</div>
<div class="type2">
<span class="type-heading">Type4 at last</span>
<span class="type-description">50 types are there</span>
<span class="type-description">makes their first $20</span>
<span class="type-description">50 types are there</span>
<span class="type-description">35 type will.</span>
</div>
</div>
CSS:
div.usertype {
margin-top: 1em;
}
div.type1 {
float: left;
margin-left: 2em;
}
span.type-heading {
font-size: 14px;
color: #f7f7f7;
}
span.type-description {
font-size: 14px;
color:#959595;
display: block;
}
Output:
What I want:
Decrease the vertical distance between spans with class type-description. I tried using line-height and padding-bottom but could not move it. May be some parent div has display:block.
All type description aligned to left which are now center. If I use it float: left, it ruins the format completely.
Please help.
<div class="usertype">
<div class="type1">
<span class="type-heading">type1 is here</span>
<span class="type-description">10 types have joined</span>
<span class="type-description">35 type will.</span>
</div>
<div class="type2">
<span class="type-heading">type2 is here</span>
<span class="type-description">10 types are there</span>
<span class="type-description">35 type will.</span>
</div>
<div class="type1">
<span class="type-heading">type23 is good</span>
<span class="type-description">50 types are there</span>
<span class="type-description">50 types are there</span>
<span class="type-description">for 2 months</span>
</div>
<div class="type2">
<span class="type-heading">Type4 at last</span>
<span class="type-description">50 types are there</span>
<span class="type-description">makes their first $20</span>
<span class="type-description">50 types are there</span>
<span class="type-description">35 type will.</span>
</div>
</div>
<style>
div.usertype {
margin-top: 1em;
}
div.type1 {
float: left;
margin-left: 2em;
}
div.type2 {
float: left;
margin-left: 2em;
}
span.type-heading {
font-size: 14px;
color: #f7f7f7;
}
span.type-description {
font-size: 14px;
color:#959595;
display: block;
line-height:15px;
}
</style>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Here's the website I need to extract some election data from: http://www.bradleyelections.com/results/html/BradleyPrecSumm01.htm
<html>
<head>
<title>PrecinctSummary</title>
</head>
<style type='text/css'>
.s0_ {position:relative;width:540.75pt;height:9.75pt;}
.s1_ {position:relative;width:540.75pt;height:197.5pt;}
.s2_ {position:relative;width:540.75pt;height:45pt;}
.s3_ {position:relative;width:540.75pt;height:57.75pt;}
.s4_ {position:relative;width:540.75pt;height:24pt;}
.s5_ {position:relative;width:540.75pt;height:15pt;}
.s6_ {position:relative;width:540.75pt;height:0pt;}
.s7_ {position:relative;width:540.75pt;height:16.5pt;}
.s8_ {position:relative;width:540.75pt;height:4.5pt;}
.s9_ {position:relative;width:577.5pt;height:0.25pt;}
.s10_ {position:relative;width:577.5pt;height:97.5pt;}
.s11_ {position:relative;width:577.5pt;height:0pt;}
.s12_ {position:relative;width:577.5pt;height:0pt;}
.s13_ {position:relative;width:577.5pt;height:0pt;}
.s14_ {position:relative;width:468pt;height:15pt;}
.s15_ {position:relative;width:468pt;height:18pt;}
.s16_ {position:relative;width:468pt;height:0pt;}
.s17_ {position:relative;width:468pt;height:0pt;}
.s18_ {position:relative;width:468pt;height:0pt;}
.s19_ {position:relative;width:468pt;height:35.25pt;}
.s20_ {position:relative;width:468pt;height:0pt;}
.f0_ {position:absolute;left:310.5pt;top:4.5pt;width:220.5pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;vertical-align:bottom;}
.f1_ {position:absolute;left:9pt;top:0pt;width:43.5pt;height:8.25pt;font:8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f2_ {position:absolute;left:63pt;top:0pt;width:43.5pt;height:8.25pt;font:8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f3_ {position:absolute;left:115.5pt;top:0pt;width:48pt;height:9pt;font:8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f4_ {position:absolute;left:310.5pt;top:0pt;width:220.5pt;height:9pt;font:8pt 'Arial';line-height:9.02pt;vertical-align:middle;}
.f5_ {position:absolute;left:464.25pt;top:4.5pt;width:25.5pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f6_ {position:absolute;left:508.5pt;top:4.5pt;width:25.5pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;vertical-align:middle;}
.f7_ {position:absolute;left:135pt;top:4.5pt;width:58.5pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;vertical-align:middle;}
.f8_ {position:absolute;left:27pt;top:135pt;width:504pt;height:59.25pt;font:8pt 'Arial';line-height:9.02pt;}
.f9_ {position:absolute;left:18pt;top:24pt;width:220.5pt;height:15pt;font:bold 9pt 'Arial';line-height:10.14pt;text-align:center;vertical-align:middle;}
.f10_ {position:absolute;left:9pt;top:56.25pt;width:522pt;height:1pt;font:0pt 'Arial';overflow:hidden;border-top:solid Black 0.5pt;z-index:1;}
.f11_ {position:absolute;left:190.5pt;top:42.75pt;width:33pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f12_ {position:absolute;left:276pt;top:42.75pt;width:13.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f13_ {position:absolute;left:334.5pt;top:41.25pt;width:97.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f14_ {position:absolute;left:489pt;top:42pt;width:46.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f15_ {position:absolute;left:490.5pt;top:4.5pt;width:16.5pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;}
.f16_ {position:absolute;left:175.5pt;top:0pt;width:48pt;height:9pt;font:8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f17_ {position:absolute;left:240pt;top:0pt;width:48pt;height:9pt;font:8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f18_ {position:absolute;left:90pt;top:4.5pt;width:45pt;height:9pt;font:bold 8pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;}
.f19_ {position:absolute;left:310.5pt;top:0pt;width:121.5pt;height:13.5pt;font:8pt 'Arial';overflow:hidden;vertical-align:middle;}
.f20_ {position:absolute;left:9pt;top:4.5pt;width:252pt;height:40.5pt;font:8pt 'Arial';line-height:9.02pt;}
.f21_ {position:absolute;left:9pt;top:13.5pt;width:522pt;height:1pt;font:0pt 'Arial';overflow:hidden;border-top:solid Black 0.5pt;z-index:1;}
.f22_ {position:absolute;left:310.5pt;top:13.5pt;width:220.5pt;height:1pt;font:0pt 'Times New Roman';overflow:hidden;border-top:solid Black 0.5pt;z-index:1;}
.f23_ {position:absolute;left:9pt;top:9pt;width:364.5pt;height:15pt;font:bold 9.8pt 'Arial';line-height:10.99pt;vertical-align:middle;}
.f24_ {position:absolute;left:9pt;top:0pt;width:522pt;height:1pt;font:0pt 'Arial';overflow:hidden;border-top:solid Black 0.5pt;z-index:1;}
.f25_ {position:absolute;left:0pt;top:13.5pt;width:504pt;height:27pt;font:bold 18pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;}
.f26_ {position:absolute;left:0pt;top:13.5pt;width:126pt;height:15pt;font:9pt 'Arial';overflow:hidden;vertical-align:middle;}
.f27_ {position:absolute;left:0pt;top:40.5pt;width:531pt;height:3pt;font:3pt 'Times New Roman';overflow:hidden;background:Black;}
.f28_ {position:absolute;left:0pt;top:45pt;width:468pt;height:13.5pt;font:bold 12pt 'Times New Roman';overflow:hidden;vertical-align:middle;}
.f29_ {position:absolute;left:0pt;top:63pt;width:468pt;height:13.5pt;font:bold 12pt 'Times New Roman';overflow:hidden;vertical-align:middle;}
.f30_ {position:absolute;left:0pt;top:81pt;width:468pt;height:13.5pt;font:bold 12pt 'Times New Roman';overflow:hidden;vertical-align:middle;}
.f31_ {position:absolute;left:0pt;top:99pt;width:468pt;height:13.5pt;font:bold 12pt 'Times New Roman';overflow:hidden;vertical-align:middle;}
.f32_ {position:absolute;left:0pt;top:117pt;width:531pt;height:3pt;font:3pt 'Times New Roman';overflow:hidden;background:Black;}
.f33_ {position:absolute;left:497.25pt;top:0pt;width:22.5pt;height:22.5pt;font:9pt 'Arial';overflow:hidden;}
.f34_ {position:absolute;left:495pt;top:22.5pt;width:27pt;height:15pt;font:9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;}
.f35_ {position:absolute;left:0pt;top:0pt;width:216pt;height:13.5pt;font:9pt 'Arial';overflow:hidden;vertical-align:middle;}
.f36_ {position:absolute;left:0pt;top:0pt;width:144pt;height:13.5pt;font:9pt 'Arial';overflow:hidden;}
.f37_ {position:absolute;left:0pt;top:13.5pt;width:270pt;height:9pt;font:9pt 'Arial';overflow:hidden;}
.f38_ {position:absolute;left:315pt;top:0pt;width:216pt;height:13.5pt;font:9pt 'Arial';overflow:hidden;text-align:right;}
.f39_ {position:absolute;left:297pt;top:13.5pt;width:234pt;height:9pt;font:9pt 'Arial';overflow:hidden;text-align:right;}
.f40_ {position:absolute;left:9pt;top:0pt;width:522pt;height:1pt;font:0pt 'Arial';overflow:hidden;border-top:solid Black 0.5pt;z-index:1;}
.f41_ {position:absolute;left:39pt;top:42.75pt;width:13.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f42_ {position:absolute;left:93pt;top:42.75pt;width:13.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f43_ {position:absolute;left:150pt;top:42.75pt;width:13.5pt;height:15pt;font:bold 8pt 'Arial';line-height:9.02pt;text-align:center;vertical-align:middle;}
.f44_ {position:absolute;left:94.5pt;top:58.5pt;width:90pt;height:12pt;font:bold 9pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f45_ {position:absolute;left:94.5pt;top:76.5pt;width:90pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f46_ {position:absolute;left:185.25pt;top:27pt;width:54pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f47_ {position:absolute;left:185.25pt;top:13.5pt;width:54pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f48_ {position:absolute;left:185.25pt;top:0pt;width:54pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f49_ {position:absolute;left:184.5pt;top:58.5pt;width:54pt;height:12pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f50_ {position:absolute;left:184.5pt;top:76.5pt;width:54pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f51_ {position:absolute;left:270pt;top:0pt;width:100.5pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:right;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f52_ {position:absolute;left:370.5pt;top:0pt;width:95.25pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;text-align:center;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f53_ {position:absolute;left:0pt;top:0pt;width:185.25pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f54_ {position:absolute;left:0pt;top:13.5pt;width:185.25pt;height:13.5pt;font:bold 9pt 'Arial';line-height:10.14pt;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f55_ {position:absolute;left:0pt;top:27pt;width:185.25pt;height:13.5pt;font:bold 9pt 'Arial';line-height:10.14pt;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f56_ {position:absolute;left:0pt;top:4.5pt;width:54pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;vertical-align:middle;}
.f57_ {position:absolute;left:54pt;top:4.5pt;width:63pt;height:13.5pt;font:bold 9pt 'Arial';overflow:hidden;vertical-align:middle;}
.f58_ {position:absolute;left:0pt;top:22.5pt;width:103.5pt;height:12.75pt;font:bold 10pt 'Times New Roman';overflow:hidden;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:Gainsboro;}
.f59_ {position:absolute;left:103.5pt;top:22.5pt;width:108pt;height:12.75pt;font:bold 10pt 'Times New Roman';overflow:hidden;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:Gainsboro;}
.f60_ {position:absolute;left:0pt;top:0pt;width:103.5pt;height:15pt;font:8pt 'Arial';line-height:9.02pt;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f61_ {position:absolute;left:103.5pt;top:0pt;width:108pt;height:15pt;font:8pt 'Arial';overflow:hidden;vertical-align:middle;padding:0pt 3pt;border:solid Black 0.5pt;background:White;}
.f62_ {position:absolute;left:0pt;top:0pt;width:184.5pt;height:18pt;font:bold 12pt 'Arial';overflow:hidden;vertical-align:middle;}
</style>
<body>
<div class=s1_ style="height:236pt;">
<span class=f25_>Precinct Summary Report</span>
<span class=f35_>11/4/2014 - 8:42:30 PM</span>
<span class=f33_><img src='Bradley_PrecSumm_01_files/PrecinctSummary_Field10_pic0.png' style='position:absolute;left:0pt;top:0pt'></span>
<span class=f26_>Election Date: 11/4/2014</span>
<span class=f34_>EMS</span>
<span class=f27_> </span>
<span class=f28_>Bradley County, Tennessee</span>
<span class=f29_>2014 General Election</span>
<span class=f30_>TNBRAG14</span>
<span class=f31_>11/4/2014</span>
<span class=f32_> </span>
<span class=f53_ style="left:27pt;top:135pt;">E - # Of Election Day Votes</span>
<span class=f48_ style="left:212.25pt;top:135pt;">405</span>
<span class=f51_ style="left:297pt;top:135pt;">PRECINCT STATUS:</span>
<span class=f52_ style="left:397.55pt;top:135pt;">INCOMPLETE</span>
<span class=f54_ style="left:27pt;top:148.55pt;">A - # Of Absentee and Early Votes</span>
<span class=f47_ style="left:212.25pt;top:148.55pt;">319</span>
<span class=f55_ style="left:27pt;top:162pt;">P - # Of Provisional Votes</span>
<span class=f46_ style="left:212.25pt;top:162pt;">0</span>
<span class=f44_ style="left:121.55pt;top:193.55pt;"> PUBLIC COUNT:</span>
<span class=f49_ style="left:211.55pt;top:193.55pt;">724</span>
<span class=f45_ style="left:121.55pt;top:211.55pt;"> VOTER TURNOUT:</span>
<span class=f50_ style="left:211.55pt;top:211.55pt;">33.58%</span>
</div>
<div class=s3_>
<span class=f23_>01-McDonald</span>
<span class=f9_>- - - - - - - - - - - - - - - - - - VOTES - - - - - - - - - - - - - - - -</span>
<span class=f13_> </span>
<span class=f14_> </span>
<span class=f41_>E</span>
<span class=f42_>A</span>
<span class=f43_>P</span>
<span class=f11_>TOTAL</span>
<span class=f12_>%</span>
<span class=f10_> </span>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>694</span>
<span class=f0_>Governor</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>335</span>
<span class=f2_>252</span>
<span class=f3_>0</span>
<span class=f16_>587</span>
<span class=f17_>84.58%</span>
<span class=f4_ style="height:9.45pt;">Bill Haslam (R)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>39</span>
<span class=f2_>37</span>
<span class=f3_>0</span>
<span class=f16_>76</span>
<span class=f17_>10.95%</span>
<span class=f4_ style="height:9.45pt;">Charles V. "Charlie" Brown (D)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>5</span>
<span class=f2_>5</span>
<span class=f3_>0</span>
<span class=f16_>10</span>
<span class=f17_>1.44%</span>
<span class=f4_ style="height:9.45pt;">Shaun Crowell (C)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>2</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>2</span>
<span class=f17_>0.29%</span>
<span class=f4_ style="height:9.45pt;">Isa Infante (G)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>4</span>
<span class=f2_>2</span>
<span class=f3_>0</span>
<span class=f16_>6</span>
<span class=f17_>0.86%</span>
<span class=f4_ style="height:9.45pt;">Steven Damon Coburn (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>5</span>
<span class=f2_>3</span>
<span class=f3_>0</span>
<span class=f16_>8</span>
<span class=f17_>1.15%</span>
<span class=f4_ style="height:9.45pt;">John Jay Hooker (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>3</span>
<span class=f2_>2</span>
<span class=f3_>0</span>
<span class=f16_>5</span>
<span class=f17_>0.72%</span>
<span class=f4_ style="height:9.45pt;">Daniel T. Lewis (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">Write-In</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>695</span>
<span class=f0_>Constitutional Amendment # 1</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>271</span>
<span class=f2_>213</span>
<span class=f3_>0</span>
<span class=f16_>484</span>
<span class=f17_>69.64%</span>
<span class=f4_ style="height:9.45pt;">Yes</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>116</span>
<span class=f2_>95</span>
<span class=f3_>0</span>
<span class=f16_>211</span>
<span class=f17_>30.36%</span>
<span class=f4_ style="height:9.45pt;">No</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>698</span>
<span class=f0_>Constitutional Amendment # 2</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>269</span>
<span class=f2_>216</span>
<span class=f3_>0</span>
<span class=f16_>485</span>
<span class=f17_>69.48%</span>
<span class=f4_ style="height:9.45pt;">Yes</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>122</span>
<span class=f2_>91</span>
<span class=f3_>0</span>
<span class=f16_>213</span>
<span class=f17_>30.52%</span>
<span class=f4_ style="height:9.45pt;">No</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>671</span>
<span class=f0_>Constitutional Amendment # 3</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>282</span>
<span class=f2_>227</span>
<span class=f3_>0</span>
<span class=f16_>509</span>
<span class=f17_>75.86%</span>
<span class=f4_ style="height:9.45pt;">Yes</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>93</span>
<span class=f2_>69</span>
<span class=f3_>0</span>
<span class=f16_>162</span>
<span class=f17_>24.14%</span>
<span class=f4_ style="height:9.45pt;">No</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>660</span>
<span class=f0_>Constitutional Amendment # 4</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>272</span>
<span class=f2_>210</span>
<span class=f3_>0</span>
<span class=f16_>482</span>
<span class=f17_>73.03%</span>
<span class=f4_ style="height:9.45pt;">Yes</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>104</span>
<span class=f2_>74</span>
<span class=f3_>0</span>
<span class=f16_>178</span>
<span class=f17_>26.97%</span>
<span class=f4_ style="height:9.45pt;">No</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>706</span>
<span class=f0_>United States Senate</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>321</span>
<span class=f2_>243</span>
<span class=f3_>0</span>
<span class=f16_>564</span>
<span class=f17_>79.89%</span>
<span class=f4_ style="height:9.45pt;">Lamar Alexander (R)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>56</span>
<span class=f2_>49</span>
<span class=f3_>0</span>
<span class=f16_>105</span>
<span class=f17_>14.87%</span>
<span class=f4_ style="height:9.45pt;">Gordon Ball (D)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>10</span>
<span class=f2_>5</span>
<span class=f3_>0</span>
<span class=f16_>15</span>
<span class=f17_>2.12%</span>
<span class=f4_ style="height:9.45pt;">Joe Wilmoth (C)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>2</span>
<span class=f2_>2</span>
<span class=f3_>0</span>
<span class=f16_>4</span>
<span class=f17_>0.57%</span>
<span class=f4_ style="height:9.45pt;">Martin Pleasant (G)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>4</span>
<span class=f2_>6</span>
<span class=f3_>0</span>
<span class=f16_>10</span>
<span class=f17_>1.42%</span>
<span class=f4_ style="height:9.45pt;">Tom Emerson, Jr. (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">Edmund L. Gauthier (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">Joshua James (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>2</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>2</span>
<span class=f17_>0.28%</span>
<span class=f4_ style="height:9.45pt;">Danny Page (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>1</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>1</span>
<span class=f17_>0.14%</span>
<span class=f4_ style="height:9.45pt;">Bartholomew J. Phillips (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">C. Salekin (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">Eric Schechter (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>4</span>
<span class=f2_>1</span>
<span class=f3_>0</span>
<span class=f16_>5</span>
<span class=f17_>0.71%</span>
<span class=f4_ style="height:9.45pt;">Rick Tyler (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>0</span>
<span class=f3_>0</span>
<span class=f16_>0</span>
<span class=f17_>0.00%</span>
<span class=f4_ style="height:9.45pt;">Write-In</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>678</span>
<span class=f0_>US House 4th Cong Dist</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>278</span>
<span class=f2_>196</span>
<span class=f3_>0</span>
<span class=f16_>474</span>
<span class=f17_>69.91%</span>
<span class=f4_ style="height:9.45pt;">Scott Desjarlais (R)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>76</span>
<span class=f2_>73</span>
<span class=f3_>0</span>
<span class=f16_>149</span>
<span class=f17_>21.98%</span>
<span class=f4_ style="height:9.45pt;">Lenda Sherrell (D)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>30</span>
<span class=f2_>24</span>
<span class=f3_>0</span>
<span class=f16_>54</span>
<span class=f17_>7.96%</span>
<span class=f4_ style="height:9.45pt;">Robert Rankin Doggart (I)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>0</span>
<span class=f2_>1</span>
<span class=f3_>0</span>
<span class=f16_>1</span>
<span class=f17_>0.15%</span>
<span class=f4_ style="height:9.45pt;">Write-In</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>631</span>
<span class=f0_>TN House 24th Rep District</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>353</span>
<span class=f2_>262</span>
<span class=f3_>0</span>
<span class=f16_>615</span>
<span class=f17_>97.46%</span>
<span class=f4_ style="height:9.45pt;">Kevin D. Brooks (R)</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>8</span>
<span class=f2_>8</span>
<span class=f3_>0</span>
<span class=f16_>16</span>
<span class=f17_>2.54%</span>
<span class=f4_ style="height:9.45pt;">Write-In</span>
</div>
<div class=s8_>
</div>
<div class=s5_>
<span class=f40_> </span>
<span class=f19_>VOTE FOR 1</span>
<span class=f5_> </span>
<span class=f15_> </span>
<span class=f6_> </span>
<span class=f21_> </span>
</div>
<div class=s7_>
<span class=f18_>VOTES=</span>
<span class=f7_>30</span>
<span class=f0_>Cleveland Wine at Retail Stores</span>
<span class=f22_> </span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>3</span>
<span class=f2_>13</span>
<span class=f3_>0</span>
<span class=f16_>16</span>
<span class=f17_>53.33%</span>
<span class=f4_ style="height:9.45pt;">For Wine In Stores</span>
</div>
<div class=s0_ style="height:10.23pt;">
<span class=f1_>8</span>
<span class=f2_>6</span>
<span class=f3_>0</span>
<span class=f16_>14</span>
<span class=f17_>46.67%</span>
<span class=f4_ style="height:9.45pt;">Against Wine In Stores</span>
</div>
<div class=s8_>
</div>
<div class=s2_>
<span class=f24_> </span>
</div>
<div class=s4_>
<span class=f36_>Precinct Summary Report</span>
<span class=f38_>11/4/2014 - 8:42:30 PM</span>
<span class=f37_>2014 General Election [Election Date: 11/4/2014]</span>
<span class=f39_>Page 1 of 1</span>
</div>
</body>
</html>
I'm familar with how HTML Tables work but I don't recognize the syntax in the source code. I presume it is CSS, but that still leaves the question of how to get this table into an Excel or CSV format in an automated way.
Any help would be appreciated.
Thanks
It's not a table, it's just span elements. I believe you are confusing HTML/CSS with some sort of programming language. You cannot scrape with CSS. You will need to use a programming language like PHP to do it.
Look at the PHP function file_get_contents http://php.net/manual/en/function.file-get-contents.php. Use that and pass in the full address of the page to be scraped. The function will return the entire source code. From there, you can begin massaging the data and hopefully get what you are looking for.
Try taking the string that is returned and using RegEx to break it apart, looking for patterns in the source code to return the pieces you are attempting to extract.
OR simply ask the person who's website that is for a copy of their data. I'm sure THEY have it in a nice Excel file ;-)