how to change width of loaded html file? - plotly-dash

I have an external html file saved in asset folder. I load the file and wrap it using html.Iframe(), then output to html.Div() component. How to change the width of display html file?
Here is what I do:
fig_sector_heatmap_html_frame=html.Iframe(src=html_filename_regime_df_sector_styled,
className='heatmap-sector-html-div')
component is html.Div() which will be output of html.Iframe()
tt_sector_graph_html_div_1=html.Div(id='tt-sector-plot-html-div-1',className="heatmap-sector-html-div")
in CSS file:
.heatmap-sector-html-div {
height: 30vh;
width: 80vw;
margin: 0;
}
no matter how I change width from 80vw to 120 vw, the displaedy html width never change. For example, below figure you can see there is big empty right space. I'd like to make the heatmap bigger to fill the right space. I think what I need is to zoom the html. how to do zoom?
Thanks

Related

Convert HTML resume to pdf without any change in template

I tried to convert this html resume to pdf and print it but as you see there is a problem in template after changing. For example compare skills in both html version and pdf version.
This is Github repo of this project: https://github.com/xriley/DevResume-Theme
And this is a sample of HTML file: https://themes.3rdwavemedia.com/demo/devresume/
How can I fix it for ever?
I need this: https://themes.3rdwavemedia.com/wp-content/uploads/2019/04/DevResume-Sketch-Template-PDF-Preview.pdf
Solution 1 - Without Coding:
You can select margins as custom from more settings to make changes for each page accordingly.
Then you can drag these blue dotted borders to adjust text based on your need.
As i have drag thelower border upward to make senior developer text to appear in next page.
Solution 2 - With Coding:
Simply adjust margins for each page from solution 1.
Then by using the #page in your CSS. You can modify margins when printing a document. You can't change all CSS properties with #page. Only few properties such as margins while printing the page etc.
#page:first { <----- first here is refering to only First Page
margin-left: 0.75cm;
margin-top: 0.25cm;
margin-bottom: 0.25cm;
margin-right: 0.75cm;
}
If you want to apply margins on all page then simply do this:
#page { your margins values }
You can read more about #page property here.

Why can't I set a background image?

I know it's repetitious question but I have problem with my code.
I have searched stackoverflow and w3schools for a background image setting
and wrote the code that was on both sites exactly but still I have problem with the following code.
body {
background-image: url("C:\Users\mehra\Desktop\Male-Fitness-Models-BAck.jpg");
}
or
body{ background-image: url("Male-Fitness-Models-BAck.jpg"); }
above are the codes I used for setting background, but neither of them work.
HTML picture
If the background image file location is correct you might need to add a height and width to the container of the background image.
body {
height: 500px;
width: 500px;
background-image: url("C:\Users\mehra\Desktop\Male-Fitness-Models-BAck.jpg");
}
There are a few things to investigate to ensure it always works:
1) Using the project absolute path:
ensure you have FollowSymLinks in your vhosts enabled, that way you can use / in the src to call the image.
e.g. <img src="/images/dog.png" />
2) Make sure the image exists
copy and paste the src that's displayed in the browser (inspect with firebug, or view-page source to get the link) into the url bar and see what it returns - if it's a 404 then it doesn't exist on the path you gave, if it's 403 the path might be set to really strict permissions (755 on directories and 644 for files is recommended) and you might have to tweak your vhosts file to allow people to view the content, but not access the file tree.
3) If the image does exist, there is no message (other than 200) and you're using the path correctly - then it's probably because the div is empty. A background on a div with no content will result in empty space, because the background is stretching itself over 0 pixels. Add a min-height and min-width rule to your css or use inside the div:
CSS:
div {
background: url('/images/dog.png');
min-height: 50px;
min-width: 50px;
}
HTML:
<div> </div>
4) Use a proper folder structure
by using a file tree that makes sense, it makes resources easier to manage.
Hosting every file in the DOCUMENT_ROOT is messy, I'd recommend the below structure:
|--index.html
|----images/
|----css/
|----js/
that's a basic structure, then you can add more folders based on area e.g.
|--index.html
|----[area]/
|----images/
|----css/
|----js/
body
{
background : cover;
background: url("http://quizdoo.com/wp-content/uploads/qc-images/58d2957b47354.jpg");
}
<body>
</body>
Add background size to make it visible
body
{
background: cover;
background-image: url("C:\Users\mehra\Desktop\Male-Fitness-Models-BAck.jpg");
}
If you are using a PC saved image path make sure to replace the \ with / and it will work.
example:
background-image:url("C:/Users/foldername/Desktop/images/City_Landscape_Background.jpg");

Rmarkdown html matrix output width too narrow

I'm aware of the existing options to make output wider :
option(width=200)
The issue is when using rmarkdown to go straight from an R file to html, the output is bounded by the size of the html box, not the predetermined R option for line width.
What is the CSS option or something similar I could change to get a wider output box?
I think you're looking for the max-width property of .main-container. The default bootstrap theme sets it to 940px. You can change it by adding something like this to the top of your Rmd file:
<style type="text/css">
.main-container {
max-width: 1280px;
}
</style>

Drupal 7 - Make embedded iFrame full width

I'm trying to figure out a way to make a page go full width (I'm using Drupal 7).
The page has an embedded form on it.
Previously there were two blocks, which when I removed I'd hoped the iframe would fill.
Current iframe
What I'm trying to achieve
How do I go about this? - Link
You should edit your theme's style.css file and remove the following lines (line 481):
#right {
display: block;
float: right;
width: 740px;
}
You still have an extra block in the left region (region-left-sidebar).

mediawiki: set external image width by value

Based on In MediaWiki, is there a way I can apply [[Image:<name>]] style resizing to external images?
Instead of adding an entry like this in the [[MediaWiki:Common.css]] page on the wiki
.image100px img { width: 100px; }
Would it be possible to change the css line with use of a mediawiki passed variable to set the width to an arbitrary value at runtime?
I now have 10 such lines to have a relative flexibility in external image sizing but would prefer to have something of the kind
.imagewidthpx img { width: {{{1}}}; }
I have no idea how to interact dynamically with common.css or even if this is feasible and I really need to embed external images with resizing.
Thanks
Something like this might work...
In MediaWiki:Commmon.css add:
.externalimage-holder {
position: relative;
}
.externalimage-holder img {
width: 100%;
height: auto;
}
then set up a template Template:Sized-external-image like this:
<div class="externalimage-holder" style="width:{{{1}}}">{{{2}}}</div>
and call it like this:
{{sized-external-image|250px|https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/%D0%A2%D1%80%D0%BE%D1%97%D1%86%D1%8C%D0%BA%D0%B8%D0%B9_%D0%BC%D0%BE%D0%BD%D0%B0%D1%81%D1%82%D0%B8%D1%80.jpg/1024px-%D0%A2%D1%80%D0%BE%D1%97%D1%86%D1%8C%D0%BA%D0%B8%D0%B9_%D0%BC%D0%BE%D0%BD%D0%B0%D1%81%D1%82%D0%B8%D1%80.jpg}}
Unfortunately I can't test it right now as I'm having some difficulties with my local installation.