HTML line spacing is too big? - spacing

I've tried changing the line-height to 0, and that made the spacing considerably smaller, but there's still about one cm between each line....
When I wrote the HTML in htmledit(DOT)squarefree(DOT)com/ it looked very small
http://i.stack.imgur.com/NsBG5.png
but when I put it on my blog and saved, the spacing was greatly enlarged...
http://i.stack.imgur.com/utZ6m.png
The code I was entering is
<p <span title="Made by [name]" style="background-color:black; border: double 10px #FF0000; text-align: center; font-size: 50px; font-family: arial; color: #FF0000; text-shadow: 5px 5px 4px #8A0808;">Text<br /><span style="text-align: center; font-size: 25px; font-family: arial; color: #8A0808; text-shadow: 0px 0px 0px; line-height: 0;">text<br /><span style="text-align: center; font-size: 25px; font-family: arial; color: #8A0808; text-shadow: 0px 0px; line-height: 0;">text<br /><span style="text-align: center; font-size: 25px; font-family: arial; color: #8A0808; text-shadow: 0px 0px; line-height: 0">text<br /><span style="text-align: center; font-size: 25px; font-family: arial; color: #8A0808; text-shadow: 0px 0px; line-height: 0">text<br /><span style="text-align: center; font-size: 25px; font-family: arial; color: #8A0808; text-shadow: 0px 0px; line-height: 0">text<br /><span style="line-height: 0"><br /><span style="text-align: center; font-size: 15px; font-family: georgia; color: #FF0000; text-shadow: 0px 0px; line-height: 0"> © text</span style="line-height: 0" p>

Your code is pretty messy. Most of the tags aren't closed.
<tag> gets closed with </tag>
<p>some text for a paragraph</p>
<span style="some style">some text to be displayed in that style</span>
(With the exception of self-closing tags such as <input> and <img>.
If you put elements inside of other elements (called "nesting"), you have to properly close them (like above), but in reverse of the order they were opened.
<p>this is a paragraph
<span>this is a span inside the paragraph. it gets closed before the paragraph</span>
the span is now closed, and the paragraph can be closed
</p>
But nesting isn't necessary in your case. See this example that does what you want. Here's the HTML from it:
<div style="background-color:black; border: double 10px #FF0000; text-align: center; font-size: 25px; font-family: arial; color: #FF0000; text-shadow: 5px 5px 4px #8A0808;">
<!-- Text inside these special braces is called a comment. It isn't displayed on the page -->
<!-- Beginning of <p> element -->
<!-- Change the value of "line-height" here to space lines differently -->
<p style="line-height:25px">
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
</p>
<!-- End of <p> element -->
<!-- The following "text" is in a separate <p> element, so it will be displayed by itself -->
<p>
text
</p>
</div>

Related

Tip/warning/definition/description boxes in Markdown

I need to create an usage instruction document and wanted to use Markdown for it.
To do this I need to create "eye catching" textbox like blocks containing definitions, warnings etc.
examples in this link
how do I do something like that ?
Edit 1:
I discovered callouts, this semms exactly what I need, but I fail to use them in Markdown. Any tips on that?
That is not possible directly in Markdown. However, most Markdown convertes allow you to use HTML and CSS code mixed in the Markdown code. For example:
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6;">
I am a success message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #a94442; background-color: #f2dede; border-color: #ebccd1;">
I am an error message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #31708f; background-color: #d9edf7; border-color: #bce8f1;">
I am a info message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #8a6d3b;; background-color: #fcf8e3; border-color: #faebcc;">
I am a warning message
</div>
The result looks like that:

css input number field rendering weird on certain versions of ios

The input number field doesn't render properly on ios. The number gets cut off at the bottom. It works for certain ios versions but not other ones. I'm stuck, please help
input[type=submit] {
text-align: center;
}
.page_q3 input[type="number"] {
height: 91px;
width: 110px;
color: #464356;
font-family: "Source Sans Pro";
font-size: 82px;
font-weight: 600;
text-align: center;
border: none;
border-bottom: 2px solid #464356;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
<div class="page_q3">
<div class="div_minus"><img src="<?=$templateDir?>/images/minus.jpg" class="minus" data-quantity="minus" data-field="<?=$inputName?>" /> </div>
<div class="div_number"><input type="number" id="<?=$inputName ?>" name="<?=$inputName?>" value="<?=$_SESSION[$inputName]?>" placeholder="0" /> </div>
<div class="div_plus"><img src="<?=$templateDir?>/images/plus.jpg"
class="plus" data-quantity="plus" data-field="<?=$inputName?>" /> </div>
</div>
What it should look like
https://ibb.co/y8msSpL
what it actually looks like
https://ibb.co/rkbyPF5
You might want to try removing the border-radius and padding that are added by iOS by default:
.page_q3 input[type="number"] {
-webkit-border-radius: 0;
border-radius: 0;
padding: 0;
}

WKWebView not showing image properly Instagram embed

I have problem with instagram image in my WKWebView. It does not shows properly. It show only 20% of that image
<html><head><script async src="http://platform.twitter.com/widgets.js" charset="utf-8"></script></head><body><p>Vest je potvrdio njegov sin Rik putem društvene mreže Instagram.</p>
<blockquote class="instagram-media" style="background: #FFF; border: 0; border-radius: 3px; box-shadow: 0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width: 658px; padding: 0; width: calc(100% - 2px);" data-instgrm-permalink="https://www.instagram.com/p/Bkc6yKGB3C9/" data-instgrm-version="8">
<div style="padding: 8px;">
<div style="background: #F8F8F8; line-height: 0; margin-top: 40px; padding: 50.0% 0; text-align: center; width: 100%;"> </div>
<p style="color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; line-height: 17px; margin-bottom: 0; margin-top: 8px; overflow: hidden; padding: 8px 0 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap;"><a style="color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 17px; text-decoration: none;" href="https://www.instagram.com/p/Bkc6yKGB3C9/" target="_blank" rel="noopener">A post shared by Rick Harrison (#rick_harrison)</a> on <time style="font-family: Arial,sans-serif; font-size: 14px; line-height: 17px;" datetime="2018-06-25T14:58:50+00:00">Jun 25, 2018 at 7:58am PDT</time></p>
</div>
</blockquote>
<p><br />"On je bio moj heroj. Kroz svoj život dotakao je duše mnogih ljudi, učio ih vrednostima života i porodice, teškog rada i humora", napisao je.</p>
<p>Ričard Harison rođen je 4. marta 1941. u Leksingtonu, Severna Karolina. U trenutku smrti imao je 77 godina.</p>
<p>"Zvezde zalagonica" je jedna od najpopularnijih emisija Histrory Channela od prvog emitovanja 2009. godine, koja gledaoce vodi kroz rad zalagaonice u Las Vegasu.</p>
<script async defer src="https://platform.instagram.com/en_US/embeds.js"> </script>
<style>img{display: inline; height: auto; max-width: 100%;}</style>
<style>iframe{display: inline; height: auto; max-width: 100%;}</style>
</body>
</html>

MSO Conditionals and ERB Tags

I'm trying to embedded ruby content in a MSO conditional in a mailer.html.erb in a rails server.
Because dosen't seem to work since href renders "www.example.com/edit/<%= #user[:id] %>/<%= #user[:reset_digest] %>" for mso.
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="padding-right: 10px; padding-left: 10px; padding-top:10px; padding-bottom:10px;" align="center">
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://www.example.com/doctores/edit/<%= #user[:id] %>/<%= #user[:reset_digest] %>" style="height:42px; v-text-anchor:middle; width:170px;" arcsize="15%" strokecolor="#3AAEE0" fillcolor="#3AAEE0">
<w:anchorlock/>
<center style="color:#ffffff; font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; font-size:16px;">
<![endif]-->
<a href="https://www.example.com/doctores/edit/<%= #user[:id] %>/<%= #user[:reset_digest] %>" target="_blank" style="display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #ffffff; background-color: #3AAEE0; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; max-width: 150px; width: 110px; width: auto; border-top: 0px solid transparent; border-right: 0px solid transparent; border-bottom: 0px solid transparent; border-left: 0px solid transparent; padding-top: 5px; padding-right: 20px; padding-bottom: 5px; padding-left: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;mso-border-alt: none">
<span style="font-size:12px;line-height:24px;"><span style="font-size: 16px; line-height: 32px;" data-mce-style="font-size: 16px;">Corregir Datos</span></span>
</a>
Thanks
The only solution I have found is to string concat your ruby vars into the if block and output the whole mso conditional, something like so in your case:
<%== '<!--[if mso]>
<table width="100%" ...>
<tr>
<td style="...">
<v:roundrect ... href="https://www.example.com/doctores/edit/' + #user[:id] + '/' + #user[:reset_digest] + '" style="..." ...>
<w:anchorlock/>
<center style="...">
<![endif]-->' %>
Notice the use of the <%== 'raw' erb tag, I had inconsistent results with the regular escaped <%= tag.
Is frankly an ugly, hacky solution but then its not like using mso tags for emails is pretty ;)

jQuery Mobile forms combining input elements

When using jQuery mobile, is it possible to combine a checkbox or button with a text input? Something like in my image below.
I want to use it as field validation so it will turn red or green when user updates the field.
jQuery Mobile does not include this, but you can do it via CSS.
Here is a DEMO with a couple of options
The first uses a table, so the left button is always the same size and the input grows/shrinks on window resize. While the second option uses a div and bothe button and label grow shrink.
Fot the table, the css removes borders and spacing on the table and sets the first td width to a constant value. The rest of the css makes the button and input look right:
<table id="specialContTbl">
<tr>
<td class="btntd">
<button data-role="none" id="btn">B</button>
</td>
<td class="inptd">
<input data-role="none" type="text" id="inp1" name="inp1" value="" placeholder="enter some text" />
</td>
</tr>
</table>
#specialContTbl {
border-spacing: 0;
border-collapse: collapsed;
}
#specialContTbl td {
padding:0;
margin: 0;
border: 0;
vertical-align: top;
}
#specialContTbl td:first-child{
width: 60px;
}
#specialContTbl{
width: 100%;
}
#specialContTbl button, #specialContTbl input {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#specialContTbl button {
font-weight: normal;
background: #00f050;
padding: 5px;
color: #333;
border: 1px solid #d4d4d4;
border-right: 0;
border-bottom-left-radius:1em;
border-top-left-radius: 1em;
line-height: 28px;
height: 38px;
width: 100%;
float: left;
text-align: center;
cursor: pointer;
white-space:nowrap;
}
#specialContTbl input {
width: 100%;
height: 38px;
padding: 8px;
border: 1px solid #d4d4d4;
border-bottom-right-radius: 1em;
border-top-right-radius: 1em;
line-height: 18px;
float: right;
box-shadow: inset 0px 2px 2px #ececec;
}
#specialContTbl input:focus {
outline: 0;
}

Resources