Reputation: 199
I am trying to add a border to some conetnt on wordpress, and because i do not know how to add a css file i was trying to do everything in html (or at least i think is html). My knowledge of coding is left to my years in highschool.
This is the content around which i want to create a simple black border of 1 or 2 px:
<iframe src="https://link_to_my_file/file.pdf" style="width:1000px; height:300px;" frameborder="1"></iframe>
however this does not work. So i tried this way:
<iframe src="https://link_to_my_file/file.pdf" style="width:1000px; height:300px;" frameborder="1"></iframe> <style> iframe.solid {border-style:solid} </style>
but this also did not work.
How do i put things in the proper way without necessarily using a separate css file?
Upvotes: 9
Views: 34991
Reputation: 5334
The out put will not work in the snippet.
Attribute which are deprecated in HTML5 for <iframe>
scrolling
frameborder
align
longdesc
marginwidth
instead of using these as iframe inline attribute you can use it in css
DEMO:
iframe{
border:4px solid red;
}
<iframe src="https://www.google.co.in/?gfe_rd=cr&dcr=0&ei=WyV_WvDBOY_E8wfHmba4Aw"></iframe>
visit this link for more info of deprecated attributes
Upvotes: 1
Reputation: 15050
Just add border declaration to style="" inside iframe tag.
<iframe src="https://link_to_my_file/file.pdf" style="width:1000px; height:300px; border: 2px solid red"></iframe>
Upvotes: 0
Reputation: 1905
If you want to use inline HTML styling:
<iframe src="https://link_to_my_file/file.pdf"
style="width:1000px; height:300px; border: 1px solid black;"></iframe>
Upvotes: 9