Is it possible to setup background color on hackmd? - hackmd

I usually use hackmd for personal note about shell script & yaml code. But the hackmd's default code block background is gray. Sometimes the gray background color is hard to view. Thus, is there any way to setup background color and font color? If so, please provide the example and appreciate that.

After googling and verification for a while time, I use following simple code to change code block background color. Post in here for reference.
<style>
.markdown-body pre, code{
background-color: #DCDCDC;
color: black;
border: 1px solid #EAEAEA;
border-radius: 3px 3px 3px 3px;
margin: 0 2px;
padding: 0 5px;
white-space: nowrap;
}
</style>

Related

how to remove left and top border from a text box?

I'm trying to put text inside a box in the shape of a corner, with no top or left border, as shown in the image below
.
I've tried many CSS tricks by changing the color of each border, so I chose transparent for the left and top borders, but here's the issue i want to add :after for the same box so i cannot add it since i have a transparent borders so the extra border thingy will not look like the image .
border-color: transparent #0ff #f0f transparent;
I just discovered there is a proprety called "border-style" this proprety solved my problem please check out the code :
.box {
background-color: lightgrey;
width: 300px;
border: 7px solid green;
padding: 50px;
margin: 20px;
border-right-style: none;
border-top-style: none;
}

PagerSetting at the bottom of a grid does not display correct

Is there a way to fix the vertical layout of the PagerSettings when displayed at the bottom of a grid?
UPDATE: I am working on build 19.110.0013
I am trying to add numbers to the bottom of a grid using the PagerSettings tag described in the post Add page numbers to the bottom of Process Shipments grid. When I set the PagerVisible to bottom the numbers display vertical, but if I set the PagerVisible to top the numbers are properly displayed as horizontal.
<ActionBar PagerVisible="Bottom" DefaultAction="cmdItemDetails">
<PagerSettings Mode="Numeric" LinksCount="5" />
</ActionBar>
I could not reproduce that behavior in Acumatica version 19.106.0020 so I manually tweaked the CSS in order to reproduce that glitch.
Setting 'display: block' CSS property on GridPagerLink CSS class reproduces the same rendering.
In file '\App_Themes\Default\00_Controls.css' it is set as 'display: inline-block;'.
Inline option will make them stack horizontally so I don't have this glitch on my side.
Which exact Acumatica version are you running?
Use browser HTML inspect element feature to inspect the GridPagerLink.
Does it look like the default style below?
.GridPagerLink {
display: inline-block;
color: RGBA(0, 0, 0, 0.87);
text-decoration: none;
font-size: 15px;
font-weight: bold;
padding: 5px 10px;
height: 18px;
border: solid 1px transparent;
}

Closing an advertisement with dynamic ID

First of all, I'd like to apologize for the lack of a serviceable example of what my code looks like. Unfortunately it contains personal information to access a database that has been made available to my university, so I cannot post it. The link to the databse is here:
http://www.studiolegale.leggiditalia.it/#mode=home,__m=site.
Now, if you don't have a proper adblocker, you'll see that a spam popup window appears. I am building a scraper in python using Selenium, and the problem seems to be that I cannot find a way to close that window. I need to get rid of it for the purpose of my project, but I have no idea how. I tried creating an action chain to locate and click the 'X' button, but both the XPath and the ID of said button are dynamic.
I then noticed that the ID of the X button always contains 'close', so I tried writing something like
spamlist = browser.find_element_by_xpath('//div[contains(#id, "close")] ')
spamlist.click
but to no avail. It gives me no error but it doesn't close the window. I admit I am a bit of a beginner, but I really can't think of what I could be doing wrong. Is there something obvious that I am missing?
EDIT 1.1
I have been asked for the HTML code of 'close element' button. Here it is:
<div id="id70a13b6c7dclose70a13b6c7d" style="display: block !important; position: absolute !important; z-index: 10 !important; height: 70px !important; padding: 20px !important; margin-top: -20px !important; margin-left: -20px !important; box-sizing: border-box !important; left: 12px; right: auto; top: 12px; bottom: auto; transform: none; transform-origin: left top;"><div id="id70a13b6c7dclose-cross70a13b6c7d" style="display:block !important;height:30px !important;min-width:30px !important;background:#000 !important;border-radius:5px !important;border:2px solid #fff !important;white-space:nowrap !important;position:relative !important;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;"><div id="id70a13b6c7dcross-container70a13b6c7d" style="overflow:visible !important;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;"><div id="id70a13b6c7dcross70a13b6c7d" style="position:absolute !important;height:20px !important;width:20px !important;top:3px !important;left:3px !important;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOAgMAAABiJsVCAAAADFBMVEUAAAD///////////84wDuoAAAAA3RSTlMAgGJiSVzhAAAAOElEQVQI12PQYGBqYNjLwP6AYb+D/AMG+Qv1DgzsX/8yMDD+/8LAwFB/AUxAuGAJsBKwYrA2sAEADzMWbZHdzhcAAAAASUVORK5CYII=) !important;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNLjcgMi43Yy0uNC0uNC0uNC0xIDAtMS40bC42LS42Yy40LS40IDEtLjQgMS40IDBMNyA1IDExLjMuN2MuNC0uNCAxLS40IDEuNCAwbC42LjZjLjQuNC40IDEgMCAxLjRMOSA3bDQuMyA0LjNjLjQuNC40IDEgMCAxLjRsLS42LjZjLS40LjQtMSAuNC0xLjQgMEw3IDlsLTQuMyA0LjNjLS40LjQtMSAuNC0xLjQgMGwtLjYtLjZjLS40LS40LS40LTEgMC0xLjRMNSA3IC43IDIuN3oiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==), linear-gradient(transparent, transparent) !important;background-size:20px !important;overflow:visible !important;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;"></div></div><div id="id70a13b6c7dcounter70a13b6c7d" style="display:none !important;text-align:center !important;position:absolute !important;min-height:30px !important;min-width:30px !important;color:#fff !important;font:small-caps bold 18px/30px courier new, sans-serif !important;overflow:visible !important;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;"></div></div></div>
Chances are there that the pop up is in iframe.
So you need to switch to the frame before closing the pop up.
Driver.SwitchTo().frame("frame xpath");
Driver.findElement("enter your xpath to close popup").click();
Driver.SwitchTo().defaultContent();

Resize Mathjax On Mobile

My Mathjax code looks fine on the computer but oversized on mobile: http://teach.sg/mathematics/additional-mathematics/trigonometric-functions/
Any way to resize this automatically for mobile?
Note: I am using safari on iPhone 6. Chrome gives me the same result.
I hope this simple solution will fit to you:
Just add overflow-x: scroll; to div's style that containing MathJax equation. It will make your MathJax equation scroll-able, and prevent going equation out of range.
In your example it is a div with
id="std-body-box-2864" style="color:#000000; border-top-color: #56b5ff; border-left-color: #56b5ff; border-right-color: #56b5ff; border-bottom-color: #56b5ff; background-color: #ffffff;".
Add overflow-x: scroll; at the end of style tag :
style="color:#000000; border-top-color: #56b5ff; border-left-color: #56b5ff; border-right-color: #56b5ff; border-bottom-color: #56b5ff; background-color: #ffffff; overflow-x: scroll;".
It will add a scroll at the bottom of the div. MathJax equation will stay in the "Special Angles" box.
Raw preview :
Actually there can be many solutions(including smart ones using jQuery), you can find appropriate one by googling "responsive tables in html". MathJax is using <span>, it's not actually the tables, but I hope that will help.
In this answer I found a better solution to this problem:
.MathJax_Display, .MJXc-display, .MathJax_SVG_Display {
overflow-x: auto;
overflow-y: hidden;
}

CSS vertical alignment and baseline position

I am new to CSS and recently reading the specification and having some problems in understanding the vertical-align property.
<div style="border: 1px solid black;">
<span style="border: 1px solid red; padding-left: 1px; line-height: 30px;"></span>
<span style="border: 1px solid red; padding-left: 1px;"></span>
<span style="border: 1px solid red; padding-left: 1px; line-height: 40px;"></span>
</div>
<div style="border: 1px solid black;">
<span style="border: 1px solid red; padding-left: 1px; line-height: 30px;"></span>
<span style="border: 1px solid red; padding-left: 1px;"></span>
<span style="border: 1px solid red; padding-left: 1px; line-height: 40px; vertical-align: top"></span>
</div>
<div style="border: 1px solid black;">
<span style="border: 1px solid red; padding-left: 1px; line-height: 30px; vertical-align: bottom"></span>
<span style="border: 1px solid red; padding-left: 1px;"></span>
<span style="border: 1px solid red; padding-left: 1px; line-height: 40px; vertical-align: top"></span>
</div>
Above code creates 3 div, each of them contains 3 empty inline boxes (spans):
In the 1st div, everything seems fine. All the 3 spans are aligned to the baseline of the line box.
In the 2nd div, after I set the vertical-align property to top for the 3rd span, the first two spans are moved up. And I get lost from here, I don't understand why they will be moved up, according to what rule.
The 3rd div is even more wired to me. I set the vertical-align property to bottom for the 1st span, and it causes the 2nd span to move slightly lower than the 3rd span (this will be noticed when zoom in enough).
The thing I can find in the specification says below, but what exactly are the multiple solutions? Could anyone shed more light on this?
In case they are aligned 'top' or 'bottom', they must be aligned so as to minimize the line box height. If such boxes are tall enough, there are multiple solutions and CSS 2.1 does not define the position of the line box's baseline.
I've also created a fiddle. Please run it in Firefox or Chrome if you are interested.
vertical-align is mostly used for inline element for example img tag, which is commonly set to vertical-align: middle; inorder to align correctly within the text.
Demo (Without the use of vertical-align)
Demo 2 (Using vertical-align)
Ok, so that was a general idea of how vertical-align works with a value of middle.
So, first lets see what are the valid values for vertical-align property.
Credits : Mozilla Developer Network
Now, lets solve your doubt step by step..
In the first example, everything's fine according to you but the answer is no, you are applying line-height to the span which varies, but the fact is line-height is actually not applied as the way you think...
Line height is actually not getting applied
Make it inline-block and it will be applied
You can read this answer for more information, that why using line-height on span is useless.
Moving on to your second doubt, you are having line-height on first span, second span but not the third span so what's happening here? As span is inline with the text and anyways line-height won't play the role there as I previously explained, they are happily aligned vertically with the text, whereas when you use vertical-align: top;, it doesn't move the other two boxes above that, instead it aligns to the top of the text.
See how the vertical-align: top; aligns at the top of the text
Coming to the last example of yours, in here, first span element is aligned to the very bottom as expected, well its correct, moving on to second, you said it's slightly in the lower than the third, because it is not aligned at all, line-height is what it makes that element align vertically center and last, moves a bit to the top, which is infact aligned to the top.
Lets make them inline-block and see how they actually behave..
So I hope you got the difference between all the three examples, but its necessary for you to understand the line-height property and inline-block property as well, also don't forget to refer the answer I shared.

Resources