Closed barddust closed 1 year ago
There's a typo in the syntax. It should be:
#+attr_html: :width 50%
Example from ox-hugo
test suite:
You can find more examples in the Org mode manual: https://orgmode.org/manual/Images-in-HTML-export.html
Oh, how careless i was!
And I found another annoying thing.
#+attr_html: :width 50%
works, but it just adds a class
attribute to that element. Actually, the width of the image is controlled by css style
, i.e., the width in css style
will override the width in class
attribute.
I've also tried #+attr_html: :style width:50%;
, which didn't work at all, it just produced a image without any changes.
Any suggestions?
@fingerknight
Hello, I am unable to reproduce the issue you are seeing. It will be helpful if you can post a minimal Org file that I can export myself to see the issue.
I have few tests of #+attr_html
and :width
in the ox-hugo test suite, and when I changed one of the test to use % for width, it exported as expected:
I won't be able to respond for the next 3 weeks as I will be on vacation.
Sorry about confusing, I've found what my problem really is:
it works i mean #+attr_html
, my problem is something in html
and css
. I am look for other ways.
Thanks for your time. Have fun in your vacation! :)
Hi, I met troubles when using
#+attr_html
to resize images.Here is my![image](https://user-images.githubusercontent.com/56252828/189989408-deecbfe8-1733-4015-9278-02b02caea88f.png)
org
file snippet:After rendering (![image](https://user-images.githubusercontent.com/56252828/189989545-2b9ceaa5-e3a8-4c4a-a2a7-b5054e90dda5.png)
C-c C-e H h
), i got this inmd
:The most interesting thing is, that image shrinks indeed, but![image](https://user-images.githubusercontent.com/56252828/189989915-15e51977-54d6-4ccf-af9c-e67e39a15f56.png)
#+attr_html width:50%
is rendered intohtml
too.I could not figure out what'd happened. Thanks if anyone helps! :)